Distributed Systems
46 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- 2.5 Distributed Transaction Solution: Sagahistorical
Saga gives each participant a forward operation and a compensating operation. If a step fails, compensation handles operations already completed.
- 2.6 Distributed Transaction Solution: 3PChistorical
Three-phase commit splits the preparation process into CanCommit, PreCommit, and DoCommit stages as an extension of two-phase commit.
- 2.7 Distributed Transaction Solution: Two Phaseshistorical
A two-phase transaction separates preparation from commit or rollback. These notes organize database-level 2PC and application-level TCC approaches.
- 2.8 Reliable-Message Eventual-Consistency Implementation: Local Message Tablehistorical
Using points awarded after an order as an example, the service creates the order and writes a message within a local transaction, then uses messaging to drive the points service.
- 2.9 Two-Phase Implementation: 2PChistorical
Two-phase commit first sends prepare requests to participating databases, then uses their responses to decide whether to commit or roll back.
- 2.10 Two-Phase Implementation: TCChistorical
TCC divides an application-level transaction into two phases: Try checks the business operation and reserves resources, followed by Confirm or Cancel according to the result.
- 2.11 Best-Effort Notification Implementation: MQhistorical
After a local transaction, the producer sends a message to MQ. The consumer acknowledges success, requeues on failure, and can query the producer for message status.
- 2.12 RocketMQ Transaction Messageshistorical
RocketMQ transactional messages encapsulate the local-message-table approach in the message queue to coordinate message sending with local transaction execution.
- 3. Distributed Consensus Algorithmshistorical
Consensus algorithms let nodes agree on a decision. These notes introduce their need through writes involving a client and multiple replicas.
- 3.1 Distributed Consensus Algorithm: Paxoshistorical
Paxos is a distributed consensus algorithm proposed by Lamport. These notes cover its roles and execution process through the problem of reaching agreement among nodes.