Prepare: Coordinator sends PREPARE; participants vote YES (write to log) or NO
Commit: If all YES → COMMIT; any NO → ABORT; participants apply and ACK
Property
Behavior
Atomicity
All commit or all abort
Blocking
If coordinator dies after PREPARE, participants block
Latency
2 round trips + log fsyncs
Used in
XA transactions, distributed RDBMS
8. Understanding Three-Phase Commit (3PC)
Phase
Action
CanCommit
Coordinator asks participants if they can commit
PreCommit
If all yes, coordinator says "prepare to commit"
DoCommit
Final commit; participants ACK
Note: 3PC is non-blocking with synchronous network but unsafe under network partitions. Modern systems prefer Paxos/Raft commit.
9. Understanding Distributed Snapshots
Algorithm
Purpose
Use Case
Chandy-Lamport
Consistent global snapshot via markers
Deadlock detection, checkpointing
Asynchronous Barrier Snapshot
Snapshot in stream pipeline
Apache Flink checkpointing
Copy-on-write
Point-in-time view of state
ZFS, etcd snapshots
10. Understanding Byzantine Fault Tolerance
Algorithm
Tolerates
Use Case
PBFT
(N-1)/3 malicious nodes
Hyperledger, permissioned chains
Tendermint
1/3 byzantine
Cosmos SDK
PoW (Nakamoto)
<50% hash power
Bitcoin
PoS variants
<1/3 stake byzantine
Ethereum, Solana
Note: BFT requires 3f+1 nodes to tolerate f byzantine failures. Used where actors may be malicious (blockchains, multi-org systems). Not needed in trusted DCs.