3 ms·
I thought the fact that mongodb data files were essentially mmapped was used as a critique against its durability as a primary database. Is that not true? Or w
by atonse 5y ago
I thought the fact that mongodb data files were essentially mmapped was used as a critique against its durability as a primary database. Is that not true?
Or was that not a relevant critique?
- nextaccountic 5y agoWelp, I don't know! From the link of the other comment here, Sqlite disables mmap by default because Linux provides a poor API regarding I/O errors (they are sent as a signal instead)
- jfindley 5y agoA database like mongodb is a very different animal from a http cache. The mongodb authors likely read this article (it's from 2006) when they were designing the first version of their database, and due to their almost complete unfamiliarity with what they were doing didn't understand that these two things are not alike. Databases have different classes of objects (think index vs data, though there are more than just these two), different types of access (e.g. full table scan vs single record select) and a whole lot more complexity than I can cover here. You don't really ever want to page out your indicies, but paging out data is probably fine. You likely want to avoid replacing your entire cache for full table scan of a big table. You probably want to have some concept of ensuring a single user doesn't starve out all your other 1000+ users. Etc etc. In other words, you can't get away with just opting out of memory management for a database - you need to treat different things differently. I understand that a few years in, the mongo devs eventually caught up to 1990s era mysql and realised this, leading to a new DB engine that was a bit less bad.
- jd_mongodb 5y agoMongoDB released the Wired Tiger storage engine in 2015 which replaced the MMAP storage engine. So whatever your read about MMAP is obsolete. https://www.mongodb.com/presentations/a-technical-introduction-to-wiredtiger https://www.mongodb.com/presentations/a-technical-introducti...
- atonse 5y agoYep I know that. I’m saying mmap used to be a critique. I left the place I introduced mongo to, a couple months before they bought WiredTiger
- aidenn0 5y agoIt's a valid critique, but A cache has no durability requirements.