Patterns
35 items
35 items
Trading strong consistency for availability and performance
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.
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.
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.
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.