Reputation: 773
I have read that mongodb memory maps all the data to RAM or main memory. That is all reads and write are directed to the RAM. And after every 100ms or so, is written to the disk. But even RDBMS uses pages of size 8KB and does the same. SO why do people consider memory mapped files and mongo as an advantage over RDBMS. I am not debating about other features of RDBMS vs mongo just this one storage feature.
Upvotes: 1
Views: 682
Reputation: 51565
Why do people consider memory mapped files and mongo as an advantage over RDBMS?
Having your database tables in memory allows for much faster read access. Writes are also much faster because writes can be batched and postponed for when the database becomes idle.
A disk based relational database will use a memory cache so that repetitive calls for data will access the cache rather than the disk. However, most databases are much larger than the cache size.
You use a relational database to store relational data. You use a noSQL database like MongoDB to store non relational data, like documents.
There are relational database engines like HSQLDB that will map all of the database tables to memory.
Upvotes: 1