SystemExpertsSystemExperts
Pricing

Patterns

35 items

Horizontal Scaling Pattern

15mbeginner

Retry with Backoff Pattern

15mbeginner

Queue-based Load Leveling Pattern

20mintermediate

Replication Pattern

25mintermediate

Caching Strategies Pattern

25mintermediate

Fan-out Pattern

20mintermediate

Fan-in Pattern

20mintermediate

Persistent Connections Pattern

20mintermediate

Load Balancing Pattern

20mintermediate

Circuit Breaker Pattern

20mintermediate

Bloom Filters Pattern

20mintermediate

Time-Series Storage Pattern

20mintermediate

Bulkhead Pattern

20mintermediate

Batch Processing Pattern

20mintermediate

Write-Ahead Log Pattern

20mintermediate

API Gateway Pattern

20mintermediate

Backend for Frontend Pattern

20mintermediate

Sidecar Pattern

20mintermediate

Idempotency Pattern

20mintermediate

Rate Limiting Pattern

20mintermediate

Backpressure Pattern

20mintermediate

Pub/Sub Pattern

25mintermediate

Eventual Consistency Pattern

25mintermediate

Sharding Pattern

25madvanced

Conflict Resolution Pattern

25madvanced

Strong Consistency Pattern

30madvanced

Leader Election Pattern

25madvanced

Consensus Protocols Pattern

30madvanced

Stream Processing Pattern

25madvanced

Change Data Capture Pattern

25madvanced

Distributed Locking Pattern

25madvanced

Two-Phase Commit Pattern

25madvanced

LSM Trees Pattern

25madvanced

Event Sourcing Pattern

30madvanced

CQRS Pattern

28madvanced
System Design Pattern
Consistencyeventual-consistencycap-theoremavailabilityasyncconvergenceintermediate

Eventual Consistency Pattern

Trading strong consistency for availability and performance

Used in: DNS, CDNs, Social Media|25 min read

Summary

Eventual Consistency is a consistency model where replicas converge to the same state over time, but may temporarily show different values. Unlike strong consistency which guarantees all nodes see the same data simultaneously, eventual consistency prioritizes availability and partition tolerance (AP in CAP theorem). After writes stop, all replicas eventually converge through asynchronous replication.

Key Takeaways

CAP Theorem Trade-off: Choosing AP over CP

The CAP theorem states distributed systems can only guarantee two of three: Consistency, Availability, Partition tolerance. Since partitions are inevitable, you choose between Consistency (CP) or Availability (AP). Eventual consistency chooses AP.

Convergence Guarantee, Not Time Guarantee

Eventual consistency guarantees that if no new updates are made, all replicas will eventually converge. However, there is no guarantee on how long this takes.

Asynchronous Replication

Writes are acknowledged before propagating to all replicas. This provides low latency but means different replicas temporarily see different values.

Strong consistency requires all nodes to always see the same data. During network partitions (which are inevitable), the system must choose between consistency and availability. Strong consistency means refusing operations during partitions.

Eventual Consistency Replication

Summary

Eventual Consistency is a consistency model where replicas converge to the same state over time, but may temporarily show different values. Unlike strong consistency which guarantees all nodes see the same data simultaneously, eventual consistency prioritizes availability and partition tolerance (AP in CAP theorem). After writes stop, all replicas eventually converge through asynchronous replication.

Key Takeaways

CAP Theorem Trade-off: Choosing AP over CP

The CAP theorem states distributed systems can only guarantee two of three: Consistency, Availability, Partition tolerance. Since partitions are inevitable, you choose between Consistency (CP) or Availability (AP). Eventual consistency chooses AP.

Convergence Guarantee, Not Time Guarantee

Eventual consistency guarantees that if no new updates are made, all replicas will eventually converge. However, there is no guarantee on how long this takes.

Asynchronous Replication

Writes are acknowledged before propagating to all replicas. This provides low latency but means different replicas temporarily see different values.

Conflict Resolution is Required

Concurrent writes to different replicas create conflicts. The system needs a conflict resolution strategy: Last-Write-Wins, application-level merge, CRDTs, or vector clocks.

Real-World Examples

DNS is eventually consistent—updates take time (TTL) to propagate. CDNs cache content that takes time to invalidate. Social media shows different users different views temporarily.

Monotonic Reads and Session Consistency

Systems often provide weaker guarantees to improve UX: monotonic reads (reads never go backwards), read-your-writes, and session consistency.

Pattern Details

Strong consistency requires all nodes to always see the same data. During network partitions (which are inevitable), the system must choose between consistency and availability. Strong consistency means refusing operations during partitions.

Eventual Consistency Replication

Trade-offs

AspectAdvantageDisadvantage

Premium Content

Sign in to access this content or upgrade for full access.