Distributed Transaction consistency in the final

Local transaction ACID we should all know, unified commit, rollback fails, strictly ensure the consistency of data within the same transaction! Prototype of a widely used and distributed transactions can not achieve such ACID, it can only be achieved in the principle of a two CAP, CAP is distributed transaction, CAP (Consistency, Availability, Partition Tolerance), describes a distributed the three main aspects of the system, can only be achieved at the same time choose the other. there are common system CP, AP system.

CP and AP principles applied in the industry there have been some framework:

CP systems have two-phase commit protocol (strong consistency)
Distributed Transaction consistency in the final

AP system there TCC (compensated Affairs)

Distributed Transaction consistency in the final

The most recent contact aspnetcore.cap is a satisfying final consistency of asynchronous messaging program implementation, where it is mysql, sqlserver provides solutions that message queue can have kafka and rabbitmq two options, according to their needs to install, the source code in the open github, but also on the corresponding bag NuGet!

To ensure that the message type - eventual consistency understanding of distributed transactions:

    1. A service to submit data
    1. Message to the message center
    1. Message center push messages to subscribers
    1. Subscribers to handle their own business logic
    1. Repeated failure to go to retry until success, rather than to the strong consistency as the A rollback

Guess you like

Origin blog.51cto.com/14230003/2423354