Overview
An eventually consistent system lets replicas diverge temporarily and guarantees only that they converge when writes stop. Expect read-after-write surprises whenever a user writes to a primary and reads from a replica or cache. Route those reads to the primary or show optimistic UI. The wider availability model is base.
Rules
- Accept it for like counts, carts, feeds, and analytics. Require strong consistency for balances, inventory, and auth state.
- Concurrent writes need a conflict rule: last-write-wins (timestamps; can silently drop a write), vector clocks, or CRDTs.
- PostgreSQL streaming and logical replication are eventually consistent for replica reads because of replication-lag.
synchronous_commit = remote_applymakes a commit wait until standbys have applied it, at a latency cost. - Systems differ: DynamoDB offers strongly consistent reads per request, and Cassandra tunes consistency per query.
Related
- replication-lag: why Postgres replicas are eventually consistent.
- base: the model that accepts it explicitly.
- acid: the stronger guarantee it relaxes.
- sharding: cross-shard reads often relax to it.
- postgres-replication: replication setup.