liveBook · Manning

Chapter 5: Transactions

What you will learn in chapter 5 of Think Distributed Systems

This introduction explains why transactions matter in distributed systems and frames the chapter around correctness and completeness rather than ACID alone.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains why transactions matter in distributed systems and frames the chapter around correctness and completeness rather than ACID alone.

Key terms: transactions, database systems, distributed systems, developer experience, concurrency, failure, certainty, ACID, atomicity, consistency

5.1 Abstractions

This section explains how layered abstractions translate between different kinds of entities while preserving results, then introduces transactions as an abstraction over concurrency and failure.

Key terms: abstraction, higher-level abstractions, lower-level abstractions, primitive expressions, API, agnostic, aware, reduction, composition, equivalence

5.2 The magic of transactions

This section introduces transactions as the reason a money-transfer web handler can appear simple despite the concurrency and failure risks of a distributed application.

Key terms: transactions, correctness, completeness, concurrent, partially synchronous distributed system, unreliable network, /transfer endpoint, source identifier, target identifier, amount

5.2.1 Concurrency

The section shows how concurrent read-and-write operations can produce an incorrect account balance and how transactions hide that concurrency from a query.

Key terms: race condition, read operation, write operation, interleaving, concurrent transfers, transactions, correctness, concurrency, race conditions

5.2.2 Failure

A two-account transfer shows how a failure between writes can leave a partial result, while a transaction guarantees a complete outcome without requiring the developer to handle that failure explicitly.

Key terms: write operations, partially applied, source account, target account, transactions, completeness, correctness, concurrency and failure-agnostic definition

5.3 The model of transactions

This section defines a transaction, introduces its ACID guarantees, and models how a program becomes an execution whose actions can be traced alongside other transactions.

Key terms: transaction, commit, abort, ACID, atomicity, consistency, application-level guarantee, platform-level guarantees, CHECK clause, program

5.3.1 Correctness

The section explains how a database can execute transactions concurrently while preserving correctness by making their combined effects equivalent to a serial execution.

Key terms: consistent state, precondition, postcondition, Hoare triple, serial history, sequential composition, concurrency anomalies, serializability, concurrency-agnostic definition

5.3.2 Serializability

Defines serializability as a correctness test for concurrent transactions and sketches how locking can enforce it while permitting concurrency.

Key terms: consistency model, execution histories, correctness guarantees, serializability, concurrent execution, sequential execution, transaction result, database state, one lock, fine-grained locks

5.3.3 Completeness

The section explains how a database makes transactions complete despite failures, focusing on Undo logging and the resulting commit and abort traces.

Key terms: completeness, failure-agnostic, failure-aware, backward recovery, Undo, forward recovery, Undo operation, Transaction Undo Log, ou, commit trace

5.3.4 Application-level abort

This section distinguishes explicit and implicit application-level aborts and states that the database undoes the aborted transaction's operations.

Key terms: application-level abort, explicit abort, implicit abort, consistency violation, Undo operations

5.3.5 Platform-level abort

This section explains how a database recovers uncommitted transactions after a crash and why Undo operations must remain safe across repeated restarts.

Key terms: platform-level abort, recovery, Transaction Undo Log, uncommitted transaction, Undo operation, restartable, noop, idempotent

5.4 Summary

The summary presents transactions as layered abstractions that let applications act as though concurrency and failure do not exist while the database handles both underneath.

Where this is used later

Concepts explained in this chapter

← Chapter 4: Message delivery and processing Chapter 6: Distributed transactions →

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.