The only reason you need chunking is because FDB has very clearly defined limits in their documentation, and one of those limits is value size - it can't exceed 100kB, and should be kept below 10kB for best performance.
For statistics like folder byte count, you could use FDB's atomic increment operation.
Here's a good starting point (not mine): https://forums.foundationdb.org/t/object-store-on-foundation...
I'll be happy to answer specific question if you got any.