The principle of MongoDB persistence _mongodb

Source: Internet
Author: User
Tags mongodb

MongoDB and MySQL, each update of MySQL will be directly written to the hard disk, but MONGO will not, as a memory database, data operations will be written to the memory, and then to persist to the hard drive, then MONGO how to persist it?

At startup, MongoDB Initializes a thread that is constantly looping (unless applied crash) to get the data to be persisted from the defer queue for a certain period of time and write to the journal (log) and Mongofile (data) at the disk. Of course because it's not written to disk when the user adds the record, so according to the MongoDB developer, it's not going to cause any performance loss, because when you see the code discovery, when you do the cud operation, the record type are put into the defer queue for late batch (GROUPCOMMIT) submissions, but believe that the time period parameter is a serious consideration of the parameters, the system is 90 milliseconds, if the value is low, it may cause frequent disk operations, too high will cause the system downtime data loss.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.