1PC, 2PC, 3PC

Source: Internet
Author: User

1pc,one phase Commit, one stage commit

This is an ordinary transaction, only a single data source is involved.

The app communicates directly with the data source, starting with a transaction, then either commit, or rollback

2pc,two phase Commit, two phase commit

Transactions that address a distributed transaction that involves multiple data sources

Requires a TM (Transaction Managers, transaction manager, direct communication with the application) to participate with RM (Resource Manager, Resource Manager, which is the individual data source)

First stage: The TM requires the relevant RM to prepare the related resources (each RM has a 1PC transaction turned on and is in a commit/rollback state), and RM returns its status to the TM: Success/failure

Phase II: The TM receives feedback from each RM, and if all succeeds, the transaction can be executed correctly, sending a commit command to all RM, and if RM fails, sends the rollback command to all RM and rolls the entire transaction back

Problems that exist:

3pc,three phase Commit, three-phase commit

Improvements to the 2PC

Resources

Real-difference-between-one-phase-and-two-phase-xa-commit

1PC, 2PC, 3PC

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.