Distributed Patterns¶
Tier: 1 (System Constraints)
Concepts: 13
Durability: Timeless (Patterns emerge from physical constraints of network communication: latency, partial failure, message ordering)
Fundamental Tensions¶
| Tension | Description |
|---|---|
| Consistency vs. Availability | The CAP theorem shows that under network partition, a system must choose between serving stale data (availability) or refusing service (consistency). This is a mathematical constraint proven by Brewer and formalized by Gilbert/Lynch. |
| Autonomy vs. Coordination | Independent services can fail/recover independently but require complex protocols for cross-service operations. Tight coordination (2PC) blocks on slow participants; loose coordination (sagas) requires compensation logic. |
| Latency vs. Correctness | Faster responses often mean less certainty. Waiting longer for acknowledgments increases reliability but degrades user experience. This is bounded by physics (speed of light) and probability (failure detection). |
| Simplicity vs. Resilience | Each resilience pattern (circuit breakers, retries, fallbacks) adds complexity. Simple systems are easier to reason about but fail catastrophically; resilient systems survive failures but are harder to debug. |
| Throughput vs. Ordering | Parallel processing increases throughput but loses ordering guarantees. Sequential processing preserves order but creates bottlenecks. This tension is fundamental to parallelism itself. |
Concepts¶
- Idempotency
- Eventual Consistency
- Saga Pattern
- Circuit Breaker Pattern
- Backpressure
- Exponential Backoff with Jitter
- Timeout Design
- Bulkhead Isolation
- Consistent Hashing
- Sharding and Partitioning
- Leader-Follower Replication
- Outbox Pattern
- Load Shedding
Cross-Domain Transfer Summary¶
| This Domain Concept | Transfers To |
|---|---|
| Idempotency | API Design, Event Processing, Payment Systems, Database Design |
| Eventual Consistency | Database Design, Caching, Distributed Filesystems, Collaboration Software |
| Saga Pattern | Workflow Systems, Payment Processing, Order Fulfillment, Travel Booking |
| Circuit Breaker | Electrical Engineering, API Clients, Service Meshes, Mobile Apps |
| Backpressure | Network Protocols, Stream Processing, Database Connections, Message Queues |
| Exponential Backoff | Network Protocols, API Clients, Database Connections, Distributed Locks |
| Timeout Design | Operating Systems, Database Queries, User Interfaces, Real-time Systems |
| Bulkhead Isolation | Ship Design, Operating Systems, Cloud Architecture, Container Orchestration |
| Consistent Hashing | Caching, Load Balancing, Database Sharding, Content Delivery |
| Sharding/Partitioning | Database Design, Multi-tenancy, Search Systems, Event Streaming |
| Leader-Follower | Database Replication, Distributed Consensus, Message Queues, Distributed Locks |
| Outbox Pattern | Event Sourcing, Message Queues, Data Integration, Audit Logging |
| Load Shedding | Operating Systems, Electrical Grids, Triage Medicine, Airport Security |
Canonical Sources¶
| Source | Coverage |
|---|---|
| Kleppmann, "Designing Data-Intensive Applications" (2017) | Comprehensive patterns synthesis; replication, partitioning, consistency models |
| Nygard, "Release It!" (2007, 2018) | Resilience patterns: circuit breaker, bulkhead, timeout |
| Helland, "Life Beyond Distributed Transactions" (2007) | Saga rationale; practical distributed system design without 2PC |
| Hohpe & Woolf, "Enterprise Integration Patterns" (2003) | Messaging patterns; integration architecture |
| Garcia-Molina & Salem, "Sagas" (1987) | Original saga pattern paper |
| Karger et al., "Consistent Hashing and Random Trees" (1997) | Foundational consistent hashing paper |
| DeCandia et al., "Dynamo: Amazon's Highly Available Key-value Store" (2007) | Eventually consistent systems; consistent hashing in practice |
| Vogels, "Eventually Consistent" (2008) | Consistency model clarification |
| Brewer, "CAP Twelve Years Later" (2012) | CAP theorem nuances |
| Lamport, "Paxos Made Simple" (2001) | Consensus fundamentals |
| Ongaro & Ousterhout, "In Search of an Understandable Consensus Algorithm (Raft)" (2014) | Accessible consensus algorithm |
| Google SRE Book (2016) | Operational patterns: load shedding, timeout budgets |
| Richardson, "Microservices Patterns" (2018) | Modern saga and outbox implementations |
| Jacobson, "Congestion Avoidance and Control" (1988) | Foundational network flow control |
| Welsh et al., "SEDA" (2001) | Staged event-driven architecture; load shedding |