Summary AI-generated
Summarised by an AI assistant when this source was saved. Double-check against the original.
In summary, the most interesting aspect is the industry's deliberate shift from theoretically perfect but practically flawed Two-Phase Commit to the pragmatic, eventually consistent Saga pattern, recognizing that large-scale systems prioritize availability and resilience over strict atomicity.
- Single-database transactions offer atomicity and isolation but fail to scale under heavy load.
- Splitting data across services breaks atomicity, creating distributed transaction challenges.
- Two-Phase Commit (2PC) guarantees strong consistency but is a blocking protocol prone to deadlocks and bottlenecks.
- The Saga pattern is the industry standard, trading strong consistency for eventual consistency and non-blocking operations.
- Sagas rely on compensating actions (like refunds) rather than rollbacks, which are visible and inherently imperfect.
- Orchestration is generally preferred over choreography for complex flows due to centralized visibility and control.
- The dual-write problem requires solutions like the transactional outbox pattern to ensure reliable event publishing.
- Co-locating related data in a single database is always the optimal first step to avoid distributed transactions entirely.
Notes this inspired
- Distributed transactionsGrowing
2 phase commit and saga patterns are the most common ways to solve this. You can have a coordinator plan across services and commit all at once, but this is fragile if…
Also cited by
- System DesignEstablished
Hello interview in a hurry is the best resource: https://www.hellointerview.com/learn/system-design/in-a-hurry/introduction. Book - Designing Data-Intensive Applications (haven't extracted all notes yet)
- Database ACIDGrowing
- Database ShardingEstablished
Write-heavy: Too much data for 1 instance (storage or write per second) Read-heavy: when read replicas or caching are not enough. Global queries will be slower. Complexity to operate and keep data…