liveBook · Manning

What you will learn in Think Distributed Systems

Mental models of reliable and scalable software

by Dominik Tornow

Chapter by chapter

Chapter 1: Thinking in distributed systems: Models, mindsets, and mechanics

The chapter introduces distributed systems as interacting components and explains why engineers need them to build applications that remain functional under load and failure.

1.1 Software engineering and mental models · 1.1.1 Mental models: The foundation of reasoning · 1.1.2 Correct mental models · 1.1.3 Complete mental models · 1.2 Mental model of software systems · 1.3 Different types of models · 1.3.1 Different models describing the same aspects · 1.3.2 Different models describing different aspects of a system · 1.4 Thinking about distributed systems · 1.4.1 Correctness · 1.4.2 Scalability and reliability · 1.4.3 Responsiveness · 1.5 Two big ideas · 1.5.1 Systems of systems · 1.5.2 Global view vs. local view · 1.6 Distributed Systems Incorporated · 1.7 Navigating complexity · 1.7.1 Simple yet complex · 1.7.2 Emergent behavior · 1.7.3 Changing perspective · 1.7.4 Think globally; act locally · 1.8 Thinking above the code · 1.9 Summary

What you learn in chapter 1 →

Chapter 2: System models, order, and time

The chapter introduces system models, order, and time as tools for reasoning about what distributed-system behavior can and cannot reveal.

2.1 System models · 2.1.1 Theory and practice · 2.1.2 Synchronous distributed systems · 2.1.3 Asynchronous distributed systems · 2.1.4 Partially synchronous systems · 2.1.5 Component and network behavior · 2.1.6 Realistic system models · 2.2 Order and time · 2.2.1 The happened-before relationship · 2.2.2 Time and clocks · 2.2.3 Physical time and physical clocks · 2.2.4 Logical time and logical clocks · 2.2.5 Physical clocks vs. logical clocks · 2.3 Summary

What you learn in chapter 2 →

Chapter 3: Failure tolerance

The chapter introduction defines the purpose of failure tolerance and frames the chapter as a theoretical and practical exploration of failure.

3.1 In theory · 3.2 Types of failure tolerance · 3.2.1 Masking failure tolerance · 3.2.2 Nonmasking failure tolerance · 3.2.3 Fail-safe failure tolerance · 3.2.4 None of the above · 3.3 In practice · 3.3.1 System model · 3.3.2 Failure handling · 3.3.3 Failure classification · 3.3.4 Failure detection · 3.3.5 Failure mitigation · 3.3.6 Putting everything together · 3.4 Summary

What you learn in chapter 3 →

Chapter 4: Message delivery and processing

The chapter introduces message delivery and processing by distinguishing literal exactly-once processing from exactly-once processing semantics and warning against assuming guarantees are broader than stated.

4.1 Exchanging messages · 4.2 The uncertainty principle of message delivery and processing · 4.2.1 Before sending the request · 4.2.2 After sending the request and before receiving a response · 4.2.3 After receiving a response · 4.3 Silence and chatter · 4.4 Exactly-once processing semantics · 4.5 Idempotence · 4.6 Case study: Charging a credit card · 4.7 Summary

What you learn in chapter 4 →

Chapter 5: Transactions

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

5.1 Abstractions · 5.2 The magic of transactions · 5.2.1 Concurrency · 5.2.2 Failure · 5.3 The model of transactions · 5.3.1 Correctness · 5.3.2 Serializability · 5.3.3 Completeness · 5.3.4 Application-level abort · 5.3.5 Platform-level abort · 5.4 Summary

What you learn in chapter 5 →

Chapter 6: Distributed transactions

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

6.1 Atomic commitment: From a single RM to multiple RMs · 6.1.1 Transaction on a single RM · 6.1.2 Transaction on multiple RMs · 6.1.3 Blocking and nonblocking · 6.2 The essence of distributed transactions · 6.3 Two-Phase Commit protocol · 6.3.1 In the absence of failure · 6.3.2 In the presence of failure · 6.3.3 Improvement · 6.4 Summary

What you learn in chapter 6 →

Chapter 7: Partitioning

The introduction contrasts partitioning with replication and previews the partitioning topics covered in the chapter.

7.1 Encyclopedias and volumes · 7.2 Thinking in partitions · 7.3 The mechanics of partitioning and balancing · 7.4 (Re)partitioning · 7.4.1 Types of partitioning · 7.4.2 Data item to partition assignment strategies · 7.5 Common item-based assignment strategies · 7.5.1 Range partitioning · 7.5.2 Hash partitioning · 7.6 Repartitioning · 7.6.1 Range partitioning · 7.6.2 Hash partitioning · 7.7 Consistent hashing · 7.8 (Re)balancing and overpartitioning · 7.9 Summary

What you learn in chapter 7 →

Chapter 8: Replication

The chapter introduces redundancy as a way to preserve durable promises when components can fail.

8.1 Redundancy · 8.2 Thinking about replication and consistency · 8.3 Replication · 8.4 The mechanics of replication · 8.4.1 System model · 8.4.2 Replication lag · 8.4.3 Synchronous vs. asynchronous replication · 8.4.4 State-based vs. log-based replication · 8.4.5 Single-leader, multileader, and leaderless systems · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Consistency

The introduction contrasts database consistency with the multiple meanings of consistency in distributed systems and previews the chapter’s topics.

9.1 Consistency models · 9.1.1 Common consistency models · 9.1.2 Virtues and limitations · 9.2 Linearizability · 9.2.1 Queue and stack · 9.2.2 Formal definition of linearizability · 9.3 Eventual consistency · 9.3.1 The shopping cart · 9.3.2 Variants of eventual consistency · 9.3.3 Implementation · 9.4 Consistency, availability, and partition tolerance · 9.4.1 History · 9.4.2 Conjecture vs. theorem · 9.4.3 CAP theorem · 9.5 Summary

What you learn in chapter 9 →

Chapter 10: Distributed consensus

The introduction explains why distributed consensus matters: it lets redundant processes act as one and prevents disagreements that could make an application behave incorrectly.

10.1 The challenge of reaching agreement · 10.2 System model · 10.3 State machine replication · 10.4 The origin—and irony—of consensus · 10.5 Implementing consensus · 10.5.1 Leader-based consensus · 10.5.2 Quorum-based consensus · 10.5.3 Combining leader and quorum · 10.6 Raft · 10.6.1 The log · 10.6.2 Terms · 10.6.3 Leader Election protocol · 10.6.4 Log Replication protocol · 10.6.5 State machine safety · 10.7 Raft puzzles · 10.7.1 Puzzle 1 · 10.7.2 Puzzle 2 · 10.7.3 Puzzle 3 · 10.8 Summary

What you learn in chapter 10 →

Chapter 11: Durable executions

The introduction previews the chapter’s path from process duration and failure-tolerant execution to sagas and durable executions, presenting durable execution as an abstraction that conceals failure.

11.1 The pitfalls of partial executions · 11.2 System model · 11.2.1 Process definition · 11.2.2 Process execution · 11.3 The concept of failure-transparent recovery · 11.4 Strategies of failure-transparent recovery · 11.4.1 Restart · 11.4.2 Resume · 11.5 Implementation of failure-transparent recovery · 11.5.1 Application-level implementation: Sagas · 11.5.2 Platform-level implementation: Durable execution · 11.6 Summary

What you learn in chapter 11 →

Chapter 12: Cloud and services

The chapter introduction frames cloud computing, cloud-native computing, serverless computing, and microservices as popular but vaguely defined ideas, and sets out the chapter’s approach to clarifying them.

12.1 From proactive to reactive · 12.2 Cloud computing · 12.3 Cloud-native computing · 12.4 Serverless computing · 12.4.1 Traditional · 12.4.2 Serverless · 12.4.3 Cold path vs. hot path · 12.5 Service · 12.5.1 Global view vs. local view · 12.5.2 Example recommendation service · 12.6 Final thoughts · 12.7 Summary

What you learn in chapter 12 →

Concepts explained in this book

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.