Collection of tcc articles on distributed transactions

 

The technologies that Java architects must know and know

Please, please don't ask me about the implementation principle of TCC distributed transaction during the interview! [The Architecture Notes of Shishan]

Someone finally explained the realization principle of "TCC Distributed Transaction"!

[Distributed Transaction-TCC] 1. The origin of distributed transaction and the core idea and workflow of TCC

[Distributed Transaction-TCC] 2. TCC exception scenarios and response mechanisms

[Distributed Transaction-TCC] 3. Flow chart of two stages of TCC

[Distributed Transaction-TCC] 6. The third optimization scheme of TCC: two-stage asynchronousization

Distributed transaction providers need to implement: idempotent, empty rollback, empty pre. Among them, "empty pre" can avoid the problem of transaction suspension. If you do not implement "empty rollback", it will cause data errors and seriously cause platform asset loss ( Withdrawal) or loss of user funds (payment)

Empty pre is more difficult to implement: the concurrency of "rollback instructions" needs to be considered. "select for update" or "distributed lock" pessimistic locking method, or optimistic locking method, but because empty pre is an insert operation, optimistic locking cannot be used , But the insert unique concurrency method can be used.

 

Guess you like

Origin blog.csdn.net/fei33423/article/details/112367893