O'Reilly logo

PHP and MongoDB Web Development by Rubayeet Islam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ensuring data durability

One of coolest features of MongoDB that we discussed and used in earlier chapters, is its support for fast asynchronous writes. MongoDB achieves this speed by using memory-mapped files. A memory-mapped file is a data structure that represents a file in main memory the same way it is stored on the disk. Processes accessing such a file can treat it as a part of memory, speeding up the I/O performance. MongoDB uses memory-mapped files to perform disk I/O operations. When a document is loaded in the application, MongoDB transparently loads it from the disk to memory. Any writes to the document results in writing to the appropriate address in memory. MongoDB flushes the data in memory back to the disk every 60 seconds (which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required