liveBook · Manning

Chapter 6: Distributed transactions

What you will learn in chapter 6 of Think Distributed Systems

Introduces distributed transactions as changes spanning multiple systems, defines their participants, and previews the chapter’s treatment of Two-Phase Commit.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces distributed transactions as changes spanning multiple systems, defines their participants, and previews the chapter’s treatment of Two-Phase Commit.

Key terms: distributed transaction, resource manager, RM, database system, message queuing system, Two-Phase Commit protocol, absence of failure, presence of failure, improvements

6.1 Atomic commitment: From a single RM to multiple RMs

This section uses a money transfer to show why atomic commitment across multiple resource managers requires coordination rather than a single manager’s local commit.

Key terms: transaction, atomic, commit, abort, resource manager, RM, subtransaction, completeness, atomic commit protocols, local state

6.1.1 Transaction on a single RM

A transaction on one resource manager achieves atomic commitment through a single local commit-or-abort write, with an unwritten decision treated as an abort after failure.

Key terms: RM, atomicity, atomic write, commit entry, abort entry, local state

6.1.2 Transaction on multiple RMs

This section explains how atomic commit keeps a transaction across multiple resource managers all-or-nothing and defines its safety and liveness guarantees.

Key terms: distributed transaction, RM, atomic commit protocol, subtransaction, atomicity, safety, liveness, participant, commit state, abort state

6.1.3 Blocking and nonblocking

This subsection distinguishes blocking from nonblocking atomic commit protocols by what they guarantee when a participant fails.

Key terms: atomic commit protocols, blocking, nonblocking, safety, liveness, participant failure

6.2 The essence of distributed transactions

This section gives a state-based mental model for reasoning about distributed transactions and atomic commit protocols.

Key terms: distributed transaction, global transaction, nondistributed transaction, local transaction, working, prepared, committed, aborted, state vector, outstanding messages

6.3 Two-Phase Commit protocol

Introduces Two-Phase Commit as a blocking atomic commit protocol by contrasting its guarantees with and without participant failure.

Key terms: Two-Phase Commit (2PC), atomic commit protocol, safety, liveness, blocking

6.3.1 In the absence of failure

This section traces a failure-free Two-Phase Commit execution, from the client’s request through the resource managers’ votes and the coordinator’s final decision.

Key terms: client, transaction coordinator (TC), resource manager (RM), 2PC, Prepare, ⟨Prepare, Timeout⟩, ⟨Vote-to-Commit⟩, ⟨Abort⟩, Commit, Abort

6.3.2 In the presence of failure

This section explains how two-phase commit recovers from resource manager failures but can block when the transaction coordinator fails.

Key terms: RM, Vote-to-Commit, Abort, Commit, REDO, UNDO, TC, safety, liveness, blocked

6.3.3 Improvement

This section shows how participant-to-participant communication can reduce blocking in Two-Phase Commit, but why it cannot always resolve an undecided transaction safely.

Key terms: TC, RM, ⟨Vote-to-Commit⟩, ⟨Commit⟩, ⟨Abort⟩, blocking executions, safety violation, timeout window

6.4 Summary

This summary connects local transactions to distributed atomic commitment and recaps the guarantees and failure limits of Two-Phase Commit.

Where this is used later

Concepts explained in this chapter

← Chapter 5: Transactions Chapter 7: Partitioning →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.