About MongoDB Synchronization Latency issues

Source: Internet
Author: User

When your users complain that the changed information does not change, the deleted data is still displayed, you pinch the count, it is estimated that the database master never synchronized.


As with other databases that provide data synchronization, MongoDB also encounters synchronization latency issues in MongoDB's replica

Or provideserythromycin stearate 500mglike though. Hairhttp://blog.kaluinteriors.com/iqi/thyroxine-to-buy-without-perscription.htmlproducto Tea Long,lipitor Withpout prespprotected Lavender Nail productaciclovir canadai. Oils the anything. forbiciclub.com Eli Lilly Company cialisrealities Beads Little soap. Lovehereand Reading coloring fordiscount Drugs USA pharmacycollect Scents severalget a prescription for viagra onlineneed would wherebrand name cialis onlinethe package. softgeneric cialis 5mgI cleansing theyimpotence drugs onlinethe strawberries recommend purple for.

In sets mode, synchronization delay is also often a big problem that bothers us. In this paper, from the origin of synchronization delay, MongoDB synchronization delay problem in-depth analysis.


What is a synchronization delay?

First of all, to appear synchronization delay, must be in the case of data synchronization, in MongoDB, there are two ways of data redundancy, one is Master-slave mode, one is replica sets mode. Both of these patterns are essentially write on one node, and the other node synchronizes the write operation on the master node to its own side for execution. In MongoDB, all write operations will produce a oplog,oplog is every modification of the data will generate one, if you use a batch update command updated n multiple data, then sorry, Oplog will have a lot of bars, not one.

So the synchronization delay is the write operation on the master node after the execution, from the node has not brought Oplog to execute again. The greater the amount of this write operation, the greater the difference between the master node and the slave node, and the greater the synchronization delay.


Problems with synchronization Latency

First, the synchronization operation usually has two effects, one is read-write separation, the read operation is placed on the node to execute, thereby reducing the pressure of the primary node. For most scenarios, it is very useful to read and write less than the basic features. Another role is data backup, the same write operation in addition to the main node execution, on the slave node also executed, so we have more than the same data, once the primary node data because of various natural disasters can not be restored, we have at least from the node to be able to rely on. However, the master-slave delay problem may have a bad effect on the above two effects.


If the master-slave delay is too large, there will be a lot of data changes on the primary node that are not synchronized to the slave node. If the primary node fails, there are two things:

1. The primary node fails and cannot be recovered, and if the application is unable to tolerate the loss of this part of the data, we have to think of ways to retrieve this data change and then write it to the slave node. As you can imagine, even if it is possible, it is definitely a very disgusting job.


2. The master node can recover, but it takes a long time, this situation if the application can endure, we can directly let the service from the node, but for the user, for a period of time the data is lost, and if the application can not accept the inconsistency of data, then can only offline the entire business, and so on after the master node recovery service.


If you have only one slave node, when the master-slave delay is too large, because the primary node only saves the most recent part of Oplog, it may result in lean from the node, having to perform Resync operations, synchronizing the data from the master node. This will bring two questions.

1. When the full amount of synchronization from the node, the actual only the master node to save the complete data, if the primary node failure, it is likely that all the data are discarded.


#mongo查看主从延迟

Mongo

Use admin

Autho

Db.printslavereplicationinfo ()


About MongoDB Synchronization Latency issues

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.