3 ms·
Just FYI, MongoDB storage also uses mmap internally. So we are comparing here "just mmap" with "mmap + all that connection handling, query parsing, JSON format
by fxtentacle 5y ago
Just FYI, MongoDB storage also uses mmap internally.
So we are comparing here "just mmap" with "mmap + all that connection handling, query parsing, JSON formatting, buffering, indexing, whatever stuff that MongoDb does".
And no, MongoDB is effectively never a cheap solution. They are used because they are super convenient to work with, with all things being JSON documents. But all that conversion to and from JSON comes at a price. It'll eat up 1000s of CPU cycles just to read a single document. With raw mmap, you could read 1000s of documents instead.
- jd_mongodb 5y agoMongoDB uses the Wired Tiger storage engine internally. The MMAP storage engine was removed from MongoDB in V4.2 which was released in March 2020. The MMAP engine was deprecated two years previously. In MongoDB conversion to and from raw JSON into BSON (Binary JSON) is done on the client (aka driver) so the server cycles are not consumed.
- winrid 5y agoAs another already said, Mongo doesn't use mmap anymore. Mongo doesn't convert to and from JSON. The driver uses a binary protocol.
- winrid 5y agoAnd 2 you're looking past the point. Any DB work work fine for this use case. If you wanted sharding, there's vitess for mysql, for example.