Two-phase commit and three-phase commit "distributed data consistency"

Source: Internet
Author: User

1, any one technology, is to solve a problem, there is its use of the scene.

2, consider the following application scenario: A commander, a,b,c,d four generals in four directions, the commander set up a plan for the siege tomorrow. How to ensure that four generals execute siege commands at the same time?

The first stage: the commander sent to the general news, plans to siege tomorrow, four generals respectively reply is ready.

The second stage: The commander confirms whether the four generals are ready, if they are ready, issued orders, the siege tomorrow. If there is not ready, issued orders, give up the siege, four generals and then reply again said, know.

This is the two-phase commit, in order to resolve the distributed data consistency.

3, consider the following situation: General D because of something, did not reply to the Commander is ready, this time what problem?

Commander to wait, A,b,c also have to wait, and a,b,c can not arrange to do other things tomorrow (resources are occupied), how to solve this problem?

4, in the first phase, add a stage, the commander to check the general's reply is timed out, if the timeout, can be considered general D not ready, and then notify A,b,c abandon siege plan.

Two-phase commit and three-phase commit "distributed data consistency"

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.