Reputation: 81
If a document size is 1KB and Mongo can insert or remove 8000 documents per second does that mean that given document size 8KB, Mongo will be able to process only 1000 documents?
Upvotes: 1
Views: 1983
Reputation: 16422
Any disk write will depend on the hardware properties, OS and underlying file system. Most file systems read and write data in blocks which are usually multiple of physical block size. For example 4096 bytes block sizes are quite common.
All that means that if your doc is larger than 4K and you have a 4K block size then it will need 2 blocks to write your doc, on the other hand padding might come into consideration as well for docs much smaller than block size. I don't know how Mongo optimizes writes and maybe it does some bulk writes, chaining, etc.
In general you should not concern yourself with these questions, but if you really have tons of data and somehow you think document size causes performance degradation you can do some tests with various document sizes, ask Mongo support, and read Mongo source code.
Upvotes: 1