Distributed Transactions
Two-phase commit, its blocking failure mode, and when it is still reasonable.
4 to work through
-
advanced
A stay booking spans payment authorisation, calendar reservation, host notification and a guest confirmation email. A distributed ACID transaction is not available. How do you order the steps and what do you do when a compensation fails?
3 min answer -
advanced
A workflow succeeds in one service, then the next service crashes before recording the event. How do transactional outbox, durable queues, retries, idempotent consumers and reconciliation each contribute, and which of them is not optional?
2 min answer -
advanced Multiple choice
An order at extreme e-commerce scale must reserve inventory, charge payment, create the order and notify fulfilment - across four independently deployed services. Which transaction strategy fits?
2 min answer -
advanced
Placing an order must reserve stock, charge the card and create a shipment across three services. Design it, and justify why not a distributed transaction.
2 min answer
5 terms in this topic
Atomic Commit Protocol
Any protocol ensuring that several participants reach the same decision to commit or abort — and a problem provably unsolvable with certainty in an a…
case-studyGoogle Spanner: Buying Consistency With Time
Spanner achieves globally consistent transactions by bounding clock uncertainty with dedicated hardware and deliberately waiting out that uncertainty…
patternSaga
A sequence of local transactions across services where failure is handled by compensating actions rather than by rollback.
patternTry-Confirm-Cancel
A three-phase distributed transaction where each participant first reserves resources, and a coordinator then confirms or cancels all reservations.
protocolXA Transaction
The X/Open standard interface for two-phase commit across heterogeneous resource managers, still common in enterprise middleware and rarely the right…
Neighbouring topics
Distributed Systems
General material on partial failure, coordination and distributed reasoning.
CAP & PACELC
What you must give up during a partition, and the latency choice the rest of the time.
Consistency Models
Linearizable, sequential, causal, eventual, and the session guarantees between them.
Idempotency
Making an operation safe to repeat, because a client that times out cannot know.
Retries & Backoff
Exponential backoff, jitter, retry budgets, and how retries become the outage.
Timeouts & Deadlines
Per-hop timeouts that do not compose, and the deadline budget that replaces them.
Circuit Breakers
Failing fast on a broken dependency, and what you fail fast to.
Backpressure & Flow Control
Telling callers to slow down instead of buffering into congestion collapse.
Load Shedding
Rejecting some work deliberately so the rest can be served correctly.
Bulkheads & Isolation
Partitioning resources so one dependency cannot starve the others.
Leader Election
Agreeing who is in charge, and fencing the one who no longer is.
Consensus Protocols
Raft, Paxos and quorums — what they guarantee and what they cost.
Distributed Locking
Mutual exclusion across machines, and why it is harder than it looks.
Sagas & Compensation
Replacing atomicity with semantic undo, and ordering the irreversible steps last.
Service Discovery
Finding a healthy address for something whose instances are ephemeral.
Messaging & Queues
Decoupling producer from consumer, and the semantics that come with it.
Event Streaming
Retained ordered logs, consumer offsets, partitions and replay.
Clocks & Ordering
Why wall clocks lie, and how logical clocks and versions restore order.
Failure Modes
Slow rather than down, partial, grey, and failing while reporting success.