Consistency in Practice: Examples
You'll learn: How real-world distributed systems choose and implement different consistency models based on their specific needs.
The Core Idea
Different systems prioritize different consistency models depending on whether they value strong correctness guarantees or high availability and performance. Understanding real-world examples helps you see these tradeoffs in action rather than just theory.
Real-World Systems and Their Choices
Databases
Google Spanner provides strong consistency (linearizability) across globally distributed data centers. It uses atomic clocks and GPS to establish ordering, ensuring every read sees the most recent write—even at the cost of higher latency.
Amazon DynamoDB defaults to eventual consistency for faster reads, but offers a "strongly consistent read" option when applications need it. This flexibility lets developers choose per-request.
Apache Cassandra uses tunable consistency via quorum reads/writes. You specify how many replicas must agree before returning results, trading availability for consistency as needed.
Caching Systems
Redis in single-instance mode provides strong consistency, but Redis Cluster uses eventual consistency across shards. Cached data might be stale, which is acceptable since caches prioritize speed over perfect accuracy.
Memcached offers no consistency guarantees between replicas—each cache node operates independently. Applications must handle stale data gracefully.
Coordination Services
Apache ZooKeeper guarantees linearizable writes and sequential consistency for reads from a single client. It's designed for configuration management and leader election where strong ordering matters.
etcd (used by Kubernetes) provides linearizable reads and writes through the Raft consensus algorithm, ensuring cluster state changes are strongly consistent.
Pattern Recognition
Systems handling money, inventory, or coordination typically choose stronger consistency. Systems handling user profiles, content feeds, or analytics often accept eventual consistency for better performance.
Key Takeaway: Real distributed systems select consistency models based on their use case—financial transactions demand linearizability (Spanner), while social media feeds tolerate eventual consistency (DynamoDB/Cassandra) for massive scale.