-
Foreword
-
Preface
-
Acknowledgments
-
About the Author
-
Part I: Narratives
-
Chapter 1: The Promise and Perils of Distributed Systems
-
The Limits of a Single Server
-
Separate Business Logic and Data Layer
-
Partitioning Data
-
A Look at Failures
-
Replication: Masking Failures
-
Process Crash
-
Network Delay
-
Process Pause
-
Unsynchronized Clocks
-
-
Defining the Term “Distributed Systems”
-
The Patterns Approach
-
-
Chapter 2: Overview of the Patterns
-
Keeping Data Resilient on a Single Server
-
Competing Updates
-
Dealing with the Leader Failing
-
Multiple Failures Need a Generation Clock
-
Log Entries Cannot Be Committed until They Are Accepted by a Majority Quorum
-
Followers Commit Based on a High-Water Mark
-
Leaders Use a Series of Queues to Remain Responsive to Many Clients
-
Followers Can Handle Read Requests to Reduce Load on the Leader
-
A Large Amount of Data Can Be Partitioned over Multiple Nodes
-
Partitions Can Be Replicated for Resilience
-
A Minimum of Two Phases Are Needed to Maintain Consistency across Partitions
-
In Distributed Systems, Ordering Cannot Depend on System Timestamps
-
A Consistent Core Can Manage the Membership of a Data Cluster
-
Gossip Dissemination for Decentralized Cluster Management
-
-
-
Part II: Patterns of Data Replication
-
Chapter 3: Write-Ahead Log
-
Problem
-
Solution
-
Implementation Considerations
-
Usage in Transactional Storage
-
Compared to Event Sourcing
-
-
Examples
-
-
Chapter 4: Segmented Log
-
Problem
-
Solution
-
Examples
-
-
Chapter 5: Low-Water Mark
-
Problem
-
Solution
-
Snapshot-Based Low-Water Mark
-
Time-Based Low-Water Mark
-
-
Examples
-
-
Chapter 6: Leader and Followers
-
Problem
-
Solution
-
Leader Election
-
Why Quorum Read/Writes Are Not Enough for Strong Consistency Guarantees
-
-
Examples
-
-
Chapter 7: HeartBeat
-
Problem
-
Solution
-
Small Clusters: Consensus-Based Systems
-
Technical Considerations
-
Large Clusters: Gossip-Based Protocols
-
-
Examples
-
-
Chapter 8: Majority Quorum
-
Problem
-
Solution
-
Deciding on Number of Servers in a Cluster
-
Flexible Quorums
-
-
Examples
-
-
Chapter 9: Generation Clock
-
Problem
-
Solution
-
Examples
-
-
Chapter 10: High-Water Mark
-
Problem
-
Solution
- Log Truncation
-
Examples
-
-
Chapter 11: Paxos
-
Problem
-
Solution
-
Flow of the Protocol
-
An Example Key-Value Store
-
Flexible Paxos
-
-
Examples
-
-
Chapter 12: Replicated Log
-
Problem
-
Solution
-
Multi-Paxos and Raft
-
Replicating Client Requests
-
Leader Election
-
Technical Considerations
-
Push vs. Pull
-
What Goes in the Log?
-
-
Examples
-
-
Chapter 13: Singular Update Queue
-
Problem
-
Solution
-
Choice of the Queue
-
Using Channels and Lightweight Threads
-
Backpressure
-
Other Considerations
-
-
Examples
-
-
Chapter 14: Request Waiting List
-
Problem
-
Solution
- Expiring Long Pending Requests
-
Examples
-
-
Chapter 15: Idempotent Receiver
-
Problem
-
Solution
-
Expiring the Saved Client Requests
-
Removing the Registered Clients
-
At-Most-Once, At-Least-Once, and Exactly-Once Actions
-
-
Examples
-
-
Chapter 16: Follower Reads
-
Problem
-
Solution
-
Finding the Nearest Replica
-
Disconnected or Slow Followers
-
Read Your Own Writes
-
Linearizable Reads
-
-
Examples
-
-
Chapter 17: Versioned Value
-
Problem
-
Solution
-
Ordering of Versioned Keys
-
Reading Multiple Versions
-
MVCC and Transaction Isolation
-
Using RocksDB-Like Storage Engines
-
-
Examples
-
-
Chapter 18: Version Vector
-
Problem
-
Solution
-
Comparing Version Vectors
-
Using Version Vector in a Key-Value Store
-
-
Examples
-
-
-
Part III: Patterns of Data Partitioning
-
Chapter 19: Fixed Partitions
-
Problem
-
Solution
-
Choosing the Hash Function
-
Mapping Partitions to Cluster Nodes
-
Alternative Solution: Partitions Proportional to Number of Nodes
-
-
Examples
-
-
Chapter 20: Key-Range Partitions
-
Problem
-
Solution
-
Predefining Key Ranges
-
An Example Scenario
-
Auto-Splitting Ranges
-
-
Examples
-
-
Chapter 21: Two-Phase Commit
-
Problem
-
Solution
-
Locks and Transaction Isolation
-
Commit and Rollback
-
An Example Scenario
-
Using Versioned Value
-
Using Replicated Log
-
Failure Handling
-
Transactions across Heterogeneous Systems
-
-
Examples
-
-
-
Part IV: Patterns of Distributed Time
-
Chapter 22: Lamport Clock
-
Problem
-
Solution
-
Causality, Time, and Happens-Before
-
An Example Key-Value Store
-
Partial Order
-
A Single Leader Server Updating Values
-
-
Examples
-
-
Chapter 23: Hybrid Clock
-
Problem
-
Solution
-
Multiversion Storage with Hybrid Clock
-
Using Timestamp to Read Values
-
Assigning Timestamp to Distributed Transactions
-
-
Examples
-
-
Chapter 24: Clock-Bound Wait
-
Problem
-
Solution
-
Read Restart
-
Using Clock-Bound APIs
-
-
Examples
-
-
-
Part V: Patterns of Cluster Management
-
Chapter 25: Consistent Core
-
Problem
-
Solution
-
Metadata Storage
-
Handling Client Interactions
-
-
Examples
-
-
Chapter 26: Lease
-
Problem
-
Solution
-
Attaching the Lease to Keys in the Key-Value Storage
-
Handling Leader Failure
-
-
Examples
-
-
Chapter 27: State Watch
-
Problem
-
Solution
-
Client-Side Implementation
-
Server-Side Implementation
-
Handling Connection Failures
-
-
Examples
-
-
Chapter 28: Gossip Dissemination
-
Problem
-
Solution
-
Avoiding Unnecessary State Exchange
-
Criteria for Node Selection to Gossip
-
Group Membership and Failure Detection
-
Handling Node Restarts
-
-
Examples
-
-
Chapter 29: Emergent Leader
-
Problem
-
Solution
-
Sending Membership Updates to All the Existing Members
-
An Example Scenario
-
Handling Missing Membership Updates
-
Failure Detection
-
Comparison with Leader and Followers
-
-
Examples
-
-
-
Part VI: Patterns of Communication between Nodes
-
Chapter 30: Single-Socket Channel
-
Problem
-
Solution
-
Examples
-
-
Chapter 31: Request Batch
-
Problem
-
Solution
- Technical Considerations
-
Examples
-
-
Chapter 32: Request Pipeline
-
Problem
-
Solution
-
Examples
-
-
-
References
-
Index
Font size
Background
Font