Concurrency control method of distributed database __ Database

Source: Internet
Author: User
classification of concurrency control methods for distributed databases 1. Methods based on a specific replica:

Primary Replica method: Each data object is set to a unique primary replica, generally set in a frequently blocked site, the primary copy of the site is the main site of the data object, different data objects have a different main site. The lock on the data object is managed by the LM (lock manager) of the site where the primary replica resides. Advantages: Reduced communication, disadvantage: Also reduces the level of concurrency.

Home Site method: To save a copy of a site as the main venue, all the blockade requests by the home site of the LM to be responsible for the management. All blocking requests are sent to the home ground to determine whether the request succeeds or waits. Pros: High data consistency. Cons: All blocking requests are at home and are prone to system bottlenecks. A home ground failure can paralyze the entire system.

Home ground method of Back field: solve the problem of home ground fault, set up another ground for the main site. 2. Voting-based methods:

Read-Write Full method: reads-Writes the whole law refers to when the transaction locks a certain data item, if is the reading lock, only then blocks one copy, namely only then sends the lock request message to the selected replica's site, if writes the lock, must block all copies, namely needs to send the lock request message to all has the data item's copy location. Therefore, the communication cost is large in the case of writing lock, and the majority method is proposed to avoid this problem.

Majority Copy method: The majority copy method means that when the data item is locked, more than half of the data items must be blocked. Lock requests are made to the site of at least (n+1)/2 replicas in n replicas, regardless of the read or write lock request. If the application succeeds, read the value of a copy, and if it is a write lock, send the new value to n copies.

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.