Eventual Consistency
Eventual consistency allows copies of data to disagree for a while after a change. If new changes stop and updates keep working, the copies should match.
source commit -> event/change -> consumer lag -> projection update -> measured convergencesource commit -> event/change -> consumer lag -> projection update -> measured convergenceJOBAnother example
A catalog renames product `42` to “Ocean.” The product page reads the new name at once. The search copy stays old for three seconds while an event consumer catches up. A lag signal returns to zero when both match.
Main parts
- 01Source of truth
- 02Change event
- 03Async channel
- 04Consumer checkpoint
- 05Stale window and lag
- 06Convergence or repair
Use it when
Use it for search copies, analytics, or separate services that can safely accept a measured delay. Measure that delay. Give people a way to repair or send missed changes again.
Do not use it when
Do not use it when a decision needs the newest value now. One example is checking permission before a sensitive action. Say when copies should match and what happens after a failure.
Name used in code
source commit -> event/change -> consumer lag -> projection update -> measured convergence Before you ship
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome: Design or review Eventual Consistency for this system while keeping data correct, secure, and easy to operate. User context: A catalog renames product `42` to “Ocean.” The product page reads the new name at once. The search copy stays old for three seconds while an event consumer catches up. A lag signal returns to zero when both match. Technical concept or control: Eventual Consistency. Why it fits: Use it for search copies, analytics, or separate services that can safely accept a measured delay. Measure that delay. Give people a way to repair or send missed changes again. Do not use it when: Do not use it when a decision needs the newest value now. One example is checking permission before a sensitive action. Say when copies should match and what happens after a failure. Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary): No single official standard controls the whole term. Its meaning may change across teams, platforms, or frameworks. Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
Check this request
Review the current use of Eventual Consistency. Definition: Eventual consistency allows copies of data to disagree for a while after a change. If new changes stop and updates keep working, the copies should match. Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.