Shared State Consistency Contract Design¶
Make the legal observations of shared state explicit, choose the weakest guarantee that still protects the real invariant, and bind that promise to read/write rules, fault assumptions, tests, telemetry, and migration behavior.
Summary¶
Make the legal observations of shared state explicit, choose the weakest guarantee that still protects the real invariant, and bind that promise to read/write rules, fault assumptions, tests, telemetry, and migration behavior.
Replicas being “mostly in sync” is not a usable correctness claim. Clients need to know which values may legally appear, after which prior operations, for how long, and under what faults. Once that contract is explicit, the design can spend coordination only where the invariant requires it and can be tested against behavior rather than labels.
A consistency model is not a vague measure of how similar replicas look. It is a public correctness contract over observations: after these operations happened, under these timing and fault conditions, which values may a client legally receive? The answer can be stronger or weaker along several independent dimensions. It may require a single order, real-time precedence, causal order, read-your-writes, monotonic sessions, a quantitative staleness bound, atomic visibility, or only deterministic convergence after communication resumes.
The solution pattern is therefore broader than choosing a database setting. It begins with domain invariants and client-visible anomalies, not protocol prestige. It then defines histories, assumptions, and costs; chooses the weakest sufficient guarantee; binds that guarantee to read, write, version, conflict, and failure behavior; exposes the semantics in the interface; and continuously tests and monitors whether the implementation still matches the promise. When the topology or setting changes, the contract must migrate as deliberately as a data schema.
The structural problem¶
Several actors or replicas read and update shared state concurrently, but the system has no precise contract for which observations are legal. Teams use vague labels such as strong, latest, synchronized, or eventual; mechanisms are chosen before invariants and client expectations are stated; read paths bypass write coordination; fault and clock assumptions remain implicit; and semantic changes are deployed as configuration changes. The result is a gap between what clients believe a successful operation means and what the system can actually guarantee.
The root tension is: Stronger shared observations usually require more ordering, waiting, metadata, quorum intersection, or refusal, while lower latency and higher partition availability permit more stale, divergent, or differently ordered observations; the design must spend coordination only where the domain invariant and client contract justify it.
Three confusions drive most failures. First, consistency is confused with replica equality: two replicas can temporarily differ while every client observation remains legal, or they can contain the same values while clients observe an illegal order. Second, consistency is confused with neighboring guarantees: durability, transaction atomicity, isolation, consensus, freshness, and availability each answer different questions. Third, a mechanism is confused with a contract: a leader, quorum, token, logical clock, CRDT-like merge, or isolation level supplies evidence only when its assumptions and scope match the promised observation semantics.
Intervention logic¶
- Inventory the logical state, copies, projections, operations, clients, and hidden read/write paths covered by the claim.
- Write the operation semantics and model the histories and observations that clients can distinguish.
- Elicit the domain invariants and concrete anomalies that are unacceptable, including per-key, cross-key, session, and real-time requirements.
- Declare topology, authority, membership, clock, communication, partition, crash, retry, and durability assumptions.
- Decompose candidate guarantees into order, visibility, freshness, session, convergence, and atomicity obligations rather than comparing labels.
- Choose the weakest contract that excludes every unacceptable anomaly under the declared assumptions and quantify its coordination, latency, availability, metadata, and refusal cost.
- Specify write acknowledgment, ordering, read selection, version propagation, conflict resolution, and degradation behavior for every operation class.
- Expose the contract through APIs, tokens, errors, freshness markers, documentation, and service objectives so clients can use it correctly.
- Construct a violation oracle and test real histories under concurrency, partitions, restart, delay, reordering, duplicate delivery, and clock uncertainty.
- Monitor semantic signals such as stale-read age, session-frontier misses, illegal histories, split-brain indicators, conflicts, repair backlog, and assumption drift.
- Define containment, reconciliation, disclosure, and appeal paths for contract violations or unresolved conflicts.
- Treat any change in guarantee, topology, metadata, default, or merge rule as a versioned migration with compatibility checks, observation, rollback, and client impact review.
The sequence deliberately starts with anomalies rather than labels. Ask what must never happen: can a user see their own confirmed update disappear? Can two regions both grant one exclusive right? May a reply appear before its cause? Is a five-minute-old dashboard acceptable? Can concurrent offline edits be merged without erasing intent? These questions reveal the minimum legal-history obligations. Only then should the team compare linearizable, sequential, causal, session, bounded-staleness, eventual, or tunable profiles.
The “weakest sufficient” rule is not an invitation to under-protect data. It is a discipline for matching coordination to consequence. If uniqueness or exclusive authority is load-bearing, a global or scoped strong order may be necessary. If a user only needs read-your-writes, a session frontier can avoid global coordination. If independent updates commute, deterministic merge may preserve both availability and correctness. The selected contract must still be explicit, enforceable, testable, and visible to clients.
Key components¶
| Component | Description |
|---|---|
| Shared-State Scope ↗ | Defines the logical state, records, keys, objects, derived views, replicas, caches, clients, and operations governed by one consistency claim. A consistency promise that does not state its object and operation scope is not testable. The scope must distinguish authoritative state from projections, caches, indexes, materialized views, and external reality; identify single-key versus multi-key behavior; and state whether read-only, write, conditional, and compound operations receive the same guarantee. |
| Client Observation Model ↗ | Describes which actors issue operations, what context they carry between operations, and which returned values, errors, timestamps, versions, or omissions count as observable behavior. Consistency is client-visible semantics, not merely replica similarity. The model should distinguish anonymous requests, sticky sessions, mobile clients, offline clients, background jobs, administrators, and downstream consumers because the same storage system can expose different guarantees to each. |
| Operation Semantics Contract ↗ | Specifies the meaning, preconditions, effects, identity, retry behavior, and composition of each read, write, update, compare, delete, and transaction-like operation. Reuse the indexed component. A legal-history claim depends on operation meaning: an increment, set, append, reservation, transfer, and conditional update have different conflict and commutativity properties. Hidden side effects and non-idempotent retries must be included. |
| Legal-History Contract ↗ | Defines which concurrent execution histories and client observations are permitted, including the order, visibility, freshness, and atomic-visibility relations that a valid history must satisfy. This is the core missing object. It should be stated in a form that can classify traces, not only as a label such as strong or eventual. A contract may require one real-time-respecting order, one total order without real-time constraints, preservation of causal order, session-local monotonicity, a staleness bound, or eventual convergence after quiescence. |
| Consistency Guarantee Profile ↗ | Names the selected guarantee and decomposes it into independently reviewable obligations for ordering, visibility, freshness, convergence, session behavior, and atomicity. Labels are overloaded across products and papers. The profile prevents “causal,” “strong,” “read committed,” or “eventual” from being treated as self-explanatory. It should say which guarantees hold globally, per key, per object, per region, per session, or only for selected operations. |
| Visibility and Order Relation ↗ | States which operations must be observed before which others, and whether the required relation follows real time, program order, causality, a single total order, a per-object order, or no cross-operation order. A system can preserve causal order without preserving a single global order, or preserve one global order that does not match wall-clock completion. The relation must name ties, concurrent operations, clock uncertainty, and the scope over which order is shared. |
| Freshness and Staleness Bound ↗ | Defines how old, how many versions behind, or how far from an acknowledged frontier a legal read may be. Freshness is not identical to ordering. A system may return an old value that is nevertheless consistent with a legal order. Bounds must identify the reference clock or version frontier, behavior when the bound cannot be met, and whether the promise is probabilistic, percentile-based, or absolute. |
| Session Guarantee Profile ↗ | Declares client-scoped guarantees such as read-your-writes, monotonic reads, monotonic writes, and writes-follow-reads, together with the context required to preserve them. Session guarantees often deliver the user experience actually needed without global linearizability. The profile must explain what constitutes a session, how context crosses devices or regions, how expiration is handled, and what happens when routing loses the required frontier. |
| Replica and Authority Topology ↗ | Maps copies, leaders, followers, shards, regions, caches, indexes, durable logs, and authority relationships that participate in producing an observation. Guarantees depend on topology. One leader with synchronous followers, multiple writable leaders, leaderless quorums, edge caches, and offline replicas have different attainable contracts and failure modes. The map should include dynamic membership and hidden read paths. |
| Fault, Partition, and Clock Assumptions ↗ | Declares communication delay, partition, crash, restart, message reordering, clock skew, duplicate delivery, lost acknowledgment, stale leader, and Byzantine assumptions relevant to the contract. A guarantee is only as strong as its fault model. “Always available and strongly consistent” is not a meaningful universal promise under arbitrary partition. Clock-based staleness and lease claims require explicit skew and uncertainty bounds. |
| Coordination, Latency, and Availability Budget ↗ | Sets the acceptable coordination rounds, read and write latency, regional reach, outage behavior, throughput cost, and refusal rate for enforcing the selected guarantee. The point is not to maximize consistency as an abstract virtue. The weakest guarantee that preserves the real invariant is often preferable. This budget makes the price of quorum, synchronous replication, stickiness, metadata, and refusal visible before the contract is chosen. |
| Write Acceptance Rule ↗ | Determines which node or quorum may accept, order, buffer, reject, redirect, or tentatively acknowledge a write under each normal and fault condition. An acknowledgment must have defined semantics: locally received, durably stored, replicated to a quorum, ordered, visible to selected readers, or globally committed. Ambiguous acknowledgments create false read-your-writes and durability expectations. |
| Read Selection Rule ↗ | Determines which replica, snapshot, version frontier, quorum, lease holder, or authority may answer a read and when the system must wait, redirect, degrade, or fail. Read routing is part of the contract. Fast nearest-replica reads can violate monotonicity or freshness unless the request carries context or the replica catches up. The rule should address hedged reads, cache hits, follower reads, and partial results. |
| Conflict Resolution Rule ↗ | Specifies how concurrent, incomparable, or duplicate updates are rejected, ordered, merged, retained for review, or represented as unresolved conflict. Reuse the indexed component. Last-writer-wins is not neutral when clocks skew or updates encode noncommutative business actions. A merge rule must be deterministic under its assumptions, preserve declared invariants, expose data loss, and state whether humans may override it. |
| Version Token ↗ | Carries operation identity, revision, epoch, term, causal frontier, snapshot, or fencing information needed to reason about what a client has seen and what state a write may safely replace. Reuse the indexed component. Tokens may be scalar versions, log positions, vector frontiers, session cookies, epochs, or opaque service-issued contexts. Their scope, comparability, expiration, and forgery resistance must be explicit. |
| Consistency Violation Oracle ↗ | Provides an executable or reviewable rule for deciding whether a captured history violates the advertised contract. A contract without a test oracle is vulnerable to semantic drift. The oracle should identify incomplete histories, uncertain timing, clock intervals, missing responses, and alternative legal linearizations rather than reporting simplistic pass/fail results. |
| Consistency Telemetry Signal ↗ | Surfaces replica lag, stale-read age, session-frontier misses, quorum failures, split-brain indicators, conflict rates, repair backlog, and observed contract violations. Infrastructure health is not enough. A green node can still return an illegal value. Telemetry should connect user-visible observations to topology, version, and fault context and distinguish expected weak-consistency behavior from genuine contract breach. |
| Client-Facing Semantics Contract ↗ | Publishes what each operation guarantees, which markers or contexts clients must preserve, what errors mean, and how behavior changes during degradation or partition. The implementation contract must reach API users, operators, auditors, and product owners. Terms such as stale, committed, durable, synchronized, latest, and available need operational definitions, not marketing language. |
| Consistency Migration Plan ↗ | Stages changes in guarantee strength, topology, metadata, routing, or merge behavior without silently reinterpreting existing data and client assumptions. Changing consistency is a semantic migration, not only a configuration edit. The plan should cover dual reads, version translation, old-client behavior, backfill, conflict handling, observation windows, rollback, and the point at which the new contract becomes authoritative. |
| Recovery and Reconciliation Path ↗ | Defines how the system detects, contains, repairs, audits, and communicates divergence or illegal observations after a mechanism or assumption fails. The contract should not promise that violations are impossible when operations can continue through faults. It should specify which state is quarantined, whether writes pause, how authority is re-established, how affected clients are notified, and when Reconciliation After Drift takes over. |
| Isolation Level ↗ | Specifies which transactional anomalies are excluded for grouped operations and snapshots inside the broader consistency contract. Reuse the indexed Concurrency Control component. Isolation is important when operations form transactions, but it should not be mistaken for the full replica-visibility and client-observation contract. |
| Merge Policy ↗ | Governs batch, replica, or offline-state recombination when several versions remain intentionally valid until convergence. Reuse the indexed component when eventual or multi-leader behavior is selected. It complements, but does not replace, the legal-history and conflict-resolution rules. |
| Assumption Register ↗ | Versions every topology, timing, failure, clock, workload, client-context, and mechanism assumption on which the guarantee depends. Reuse the indexed component. Configuration changes that invalidate an assumption must trigger contract revalidation rather than silently weakening behavior. |
| Service-Level Objective ↗ | Turns latency, availability, freshness, refusal, and recovery promises into measured operating targets without conflating service quality with semantic correctness. Reuse the indexed component. A 99.9% freshness objective is not an absolute bounded-staleness guarantee, and a 99.99% availability target does not authorize an undeclared consistency downgrade. |
| Audit Trail ↗ | Preserves contract versions, write acknowledgments, routing choices, topology terms, violation evidence, repairs, exceptions, and migration decisions. Reuse the indexed component. High-consequence balances, eligibility states, safety commands, and ownership records need evidence that explains which semantics governed each observation. |
Common mechanisms¶
Linearizable Read/Write Protocol¶
Coordinates reads and writes so each completed operation appears to take effect at one point between invocation and response, preserving real-time precedence within scope.
Sequential-Consistency Trace Protocol¶
Produces one total operation order that preserves each client or process program order without requiring that the order respect wall-clock completion.
Causal-Consistency Protocol¶
Tracks and preserves happens-before relationships while allowing concurrent unrelated updates to be observed in different orders.
Session-Guarantee Token¶
Carries a client frontier or version context across requests so read-your-writes and monotonic-session guarantees survive rerouting.
Bounded-Staleness Read Policy¶
Allows replica reads only when measured time, version, or log-position lag remains within the declared bound; otherwise waits, redirects, or fails.
Quorum Read/Write Protocol¶
Uses intersecting read and write sets, version comparison, and repair rules to obtain a selected consistency level from leaderless or replicated storage.
Leader-Based Replication¶
Orders writes through an elected or assigned leader and controls follower-read eligibility by term, commit position, lease, or catch-up state.
Multi-Leader Replication with Conflict Resolution¶
Accepts writes in more than one authority domain and later resolves or preserves concurrent versions according to declared merge semantics.
Version Vector¶
Represents per-participant causal progress so concurrent and causally ordered versions can be distinguished without relying on synchronized clocks.
Hybrid Logical Clock¶
Combines physical-time proximity with logical ordering metadata to support causality and staleness reasoning under bounded clock uncertainty.
Read Repair¶
Uses divergent read results to update stale replicas after selecting an authoritative or merged value under the contract.
Anti-Entropy Synchronization¶
Periodically compares replica summaries and exchanges missing or divergent state so replicas converge after disconnection or missed updates.
CRDT-Like State Merge¶
Uses algebraically designed state or operations whose concurrent updates merge deterministically while preserving specified invariants.
Last-Write-Wins Register¶
Selects one value using a declared timestamp or order token, suitable only when overwrite semantics and clock assumptions are acceptable.
Transaction Isolation¶
Applies an isolation level to grouped operations so prohibited transaction anomalies are excluded inside the broader shared-state contract.
Lease and Fencing-Token Protocol¶
Grants time-bounded authority and monotonically ordered fencing tokens so stale holders cannot continue mutating protected state.
Consistency History Checker¶
Analyzes captured invocation/response histories against linearizability, serial, causal, session, or custom legality predicates.
Partition and Clock Fault Injection¶
Exercises delay, loss, reordering, partition, restart, skew, stale leader, and duplicate delivery while recording client-visible outcomes.
Replica-Lag and Freshness Dashboard¶
Reports version distance, commit lag, stale-read age, session-frontier misses, repair backlog, and uncertainty in the freshness estimate.
Consistency Contract Decision Record¶
Documents the chosen contract, rejected stronger and weaker alternatives, assumptions, cost model, client obligations, test evidence, and revalidation triggers.
Safe Consistency Migration Workflow¶
Stages dual semantics, compatibility checks, metadata rollout, backfill, observation, cutover, and rollback when changing consistency behavior.
No one mechanism is the archetype. Quorum overlap can support a contract but can fail across membership epochs. A leader can order writes but stale follower reads can still break the promise. A session token can preserve one client’s frontier while other clients see different orders. CRDT-like merge can guarantee convergence only for the modeled data type and invariant. A history checker can detect sampled violations but cannot repair an underspecified contract. Mechanisms must be assembled around the complete state–history–assumption–enforcement–client–evidence loop.
Parameter dimensions¶
State scope¶
Single key, object, shard, table, graph, multi-object transaction, derived view, cache, index, or external projection.
Operation class¶
Read, write, conditional update, append, increment, reservation, transfer, delete, compare-and-swap, transaction, or background repair.
Observer scope¶
All clients, one process, one session, one user across devices, one region, one tenant, or one downstream consumer.
Order obligation¶
Real-time precedence, one global total order, per-object order, program order, causal partial order, or no cross-operation order.
Visibility obligation¶
Immediate after commit, quorum-visible, session-visible, causally ready, snapshot-consistent, prefix-consistent, or eventually visible.
Freshness obligation¶
Latest, bounded by time, bounded by versions or log positions, percentile objective, probabilistic, or unbounded best effort.
Convergence obligation¶
No divergence, temporary divergence with deterministic merge, application conflict, manual reconciliation, or no guaranteed convergence.
Transaction and atomic visibility¶
Single-operation atomicity, multi-key snapshot, serializable transaction, atomic batch visibility, or independently visible updates.
Authority topology¶
Single leader, sharded leaders, multi-leader, leaderless quorum, primary plus caches, offline peers, or hierarchical edge/core.
Fault model¶
Delay, loss, reordering, partition, crash, restart, stale leader, clock skew, duplicate delivery, storage loss, or Byzantine behavior.
Write acknowledgment¶
Locally accepted, durable locally, replicated, quorum-stored, ordered, committed, globally visible, or provisional.
Read source¶
Leader, follower, nearest replica, quorum, cache, snapshot, materialized view, or merged multi-version result.
Client context¶
Stateless, sticky route, version token, causal frontier, snapshot identifier, epoch, or application-provided precondition.
Conflict semantics¶
Reject, serialize, compare-and-swap, last-write-wins, deterministic algebraic merge, retain siblings, compensate, or human review.
Degradation policy¶
Wait, reject, redirect, serve marked stale, enter read-only mode, accept provisional writes, or switch to a named weaker contract.
Cost budget¶
Latency, coordination rounds, bandwidth, metadata size, storage, throughput, refusal rate, recovery time, and operator burden.
Evidence strength¶
Design proof, protocol argument, model check, history test, fault-injection campaign, production monitoring, or unresolved assumption.
Migration scope¶
Contract strengthening, weakening, per-operation tuning, topology change, clock/token change, merge-rule change, or client-version transition.
Invariants and outcomes¶
A strong draft states invariants as observable obligations rather than aspirations. The most important invariant is correspondence: every behavior described as legal by the public contract must be producible by the mechanism under the declared assumptions, and every prohibited behavior must be blocked, marked, or treated as a violation. A green infrastructure dashboard is not a substitute for this correspondence.
- Every advertised guarantee has an explicit legal-history definition and a matching violation oracle.
- The enforcement mechanism is sound for the declared topology and fault assumptions.
- Acknowledgment, visibility, durability, freshness, and convergence meanings are not conflated.
- No read path bypasses the version, authority, session, or freshness checks required by the contract.
- Session context is preserved, expired, or rejected according to a public rule rather than silently dropped.
- Conflict resolution is deterministic and invariant-preserving where automatic merge is claimed, or conflict remains explicitly unresolved.
- Observed staleness and replica lag are measured against the same frontier and clock semantics used by the guarantee.
- Clients can identify which consistency mode and contract version governed a response.
- Contract changes do not silently weaken old client assumptions or reinterpret previously acknowledged operations.
- Violations, uncertainty, repair, and exception decisions remain traceable to affected state and observations.
Expected outcomes include:
- Fewer stale, nonmonotonic, causally inverted, fractured, duplicated, or mutually inconsistent observations that violate real requirements.
- Lower unnecessary coordination cost because strong guarantees are concentrated on invariant-bearing operations.
- More predictable behavior during partition, lag, failover, and recovery.
- Client code that handles tokens, stale markers, unknown, conflict, and retry semantics correctly.
- Conformance tests that detect semantic regressions before topology or configuration changes reach production.
- Telemetry that translates replica health into user-visible consistency risk.
- Safer migrations among leaders, quorums, regions, databases, caches, and consistency modes.
- Clearer boundaries among consensus, concurrency control, atomicity, durability, reconciliation, and consistency.
Applicability¶
This archetype is strongest when state and operation semantics can be made precise and clients can act differently on fresh, stale, provisional, conflicting, or unknown observations. It is weak when the underlying reality is itself ambiguous or when no one can state the business invariant. Formal precision should not be used to disguise semantic uncertainty.
Works well when:
- Several clients or copies act on logically shared state and the legality of their observations matters.
- The domain can name unacceptable anomalies and the invariant strength they require.
- Read and write paths, topology, version frontiers, and fault behavior can be instrumented.
- The organization is willing to reject or delay operations when the selected guarantee cannot be met.
- Clients can carry tokens, interpret stale or conflict markers, or choose a documented consistency mode.
- The system is changing topology, storage engine, cache strategy, regional layout, or offline behavior and needs semantic migration controls.
- There is enough operational evidence to test histories and correlate violations with topology and fault events.
Weak when:
- The real-world state being represented changes independently and no authoritative observation or semantic reference can be defined.
- Business operations are underspecified, so no one can say whether two updates commute, conflict, or preserve the invariant.
- Hidden clients or data paths bypass the contract and cannot be discovered or governed.
- A guarantee is selected for marketing or prestige rather than a concrete anomaly and cost analysis.
- The deployment cannot refuse, wait, redirect, mark stale, preserve context, or expose unknown when assumptions fail.
- Clock, membership, or durability behavior is too unstable to support the chosen mechanism and no conservative fallback exists.
- Human legitimacy, consent, or policy interpretation is being reduced to a technical state-ordering problem.
Recognized variants¶
Linearizable Consistency Contract¶
Requires each operation to appear atomic at one point between invocation and response, with completed real-time precedence preserved for all clients in scope.
Distinctive feature: Real-time precedence constrains the legal global order, not only per-client or causal order.
It remains under the parent because It uses the same state scope, history model, assumptions, read/write rules, test oracle, client contract, and migration structure.
Use it when: - A stale or reordered observation could create duplicate authority, overspend, unsafe command, or broken uniqueness. - Clients need a single-copy illusion rather than merely eventual convergence. - The latency and refusal cost of coordination is acceptable.
Typical mechanisms: linearizable_read_write_protocol, leader_based_replication, quorum_read_write_protocol, consistency_history_checker.
Sequential Consistency Contract¶
Requires all operations to fit one shared total order that preserves each client or process program order, while allowing that order to differ from wall-clock completion.
Distinctive feature: One total order is shared, but completed real-time precedence is not load-bearing.
It remains under the parent because It changes the ordering obligation, not the overall intervention structure.
Use it when: - A coherent shared order matters but strict real-time visibility does not. - Clients can tolerate an operation becoming visible later than its response suggests. - The system can enforce a global order more cheaply without real-time constraints.
Typical mechanisms: sequential_consistency_trace_protocol, consistency_history_checker.
Causal Consistency Contract¶
Requires causally related operations to be observed in causal order while permitting concurrent unrelated operations to be seen in different orders.
Distinctive feature: The required order is the happens-before partial order rather than one global total order.
It remains under the parent because The same history, assumption, metadata, client-contract, and validation machinery applies.
Use it when: - Users act on earlier observations and later actions should not appear without their causes. - Global total ordering would impose unnecessary coordination. - Causal context can be propagated and retained.
Typical mechanisms: causal_consistency_protocol, version_vector, hybrid_logical_clock, session_guarantee_token.
Session Consistency Contract¶
Provides client-scoped monotonic and read-your-writes guarantees by carrying an observation frontier across requests.
Distinctive feature: The guarantee is anchored to a client session rather than all observers globally.
It remains under the parent because It uses the same read routing, token, telemetry, client semantics, and migration components.
Use it when: - A user must not see their own successful update disappear on the next request. - Global strong consistency is too expensive but per-session coherence is sufficient. - The client or gateway can retain and transmit a version frontier.
Typical mechanisms: session_guarantee_token, bounded_staleness_read_policy.
Bounded-Staleness Consistency Contract¶
Allows stale reads only within a measurable time, version, or log-position distance from a declared authoritative frontier.
Distinctive feature: Legality is constrained by a quantitative freshness threshold.
It remains under the parent because It shares the same scope, read rule, assumptions, telemetry, client contract, and violation oracle.
Use it when: - Freshness has a domain-specific tolerance rather than an all-or-nothing latest-value requirement. - Replica lag can be measured against a reliable frontier. - The system can wait, redirect, or fail when the bound is exceeded.
Typical mechanisms: bounded_staleness_read_policy, replica_lag_dashboard, hybrid_logical_clock.
Eventual Consistency with Deterministic Merge¶
Allows replicas to diverge during local updates and requires them to converge to equivalent state after communication resumes and updates quiesce, using deterministic merge semantics.
Distinctive feature: Availability and local autonomy are bought by permitting temporary divergence while preserving a convergence obligation.
It remains under the parent because It still requires an explicit legal-history, conflict, convergence, client-semantics, monitoring, and migration contract.
Use it when: - Local writes during disconnection or partition are valuable. - Temporary divergent observations are acceptable and disclosed. - The data type or domain has a defensible deterministic merge rule.
Typical mechanisms: crdt_like_state_merge, version_vector, anti_entropy_synchronization, read_repair.
Tunable or Operation-Scoped Consistency¶
Allows different operations, data classes, or requests to select different consistency strengths under a governed compatibility and invariant policy.
Distinctive feature: Consistency becomes an explicit per-operation or per-class parameter rather than one system-wide setting.
It remains under the parent because Each mode still uses the parent’s scope, history, guarantee, assumptions, tests, telemetry, and client-contract structure.
Use it when: - Some data or operations require strong invariants while others prioritize latency or availability. - Clients can select semantics without creating incoherent mixed histories. - The platform can validate cross-mode interactions and defaults.
Typical mechanisms: quorum_read_write_protocol, transaction_isolation, consistency_contract_decision_record.
Tradeoffs¶
- Consistency strength versus latency: stronger order and visibility often require waiting for a leader, quorum, lease check, or synchronized replication path.
- Consistency strength versus partition availability: preserving one legal global view may require rejecting or delaying operations when communication is insufficient.
- Freshness versus geographic locality: nearest-replica reads are faster but may need session context, lag bounds, or redirection.
- Global order versus concurrency: one total order simplifies reasoning but can serialize independent work and concentrate coordination.
- Automatic merge versus semantic fidelity: deterministic convergence can preserve availability while erasing intent or violating domain constraints if the algebra is wrong.
- Session coherence versus routing flexibility: carrying client frontiers or maintaining affinity improves read-your-writes but complicates stateless routing and failover.
- Rich causal metadata versus storage and bandwidth: vectors and dependency sets improve precision but grow with participants and require compaction.
- Tunable consistency versus cognitive load: per-operation choices save cost but create dangerous defaults and cross-mode composition problems.
- Absolute guarantees versus probabilistic objectives: hard bounds are clearer but may cause more refusal; percentile targets are cheaper but permit tail violations.
- Fast failover versus stale-authority risk: aggressive leader replacement improves recovery but requires fencing and term discipline.
- Backward compatibility versus semantic improvement: strengthening or weakening a contract can break old clients, caches, and historical assumptions.
- Conformance rigor versus observability cost: complete histories and fault tests improve confidence but require tracing, timing metadata, privacy controls, and analysis capacity.
The tradeoff surface is not one-dimensional. A system can have low latency but poor freshness, high availability but weak session behavior, strong per-key ordering but weak cross-key snapshots, or deterministic convergence that still violates a domain invariant. Each dimension should be negotiated explicitly. The correct answer is often a portfolio: strong semantics for exclusive rights and balances, session semantics for user-facing settings, bounded staleness for views, and deterministic convergence for commutative offline data.
Failure modes¶
Guarantee by label only¶
Cause: The system says strong, causal, serializable, latest, or eventual without an explicit legal-history predicate.
Mitigation: Decompose order, visibility, freshness, session, convergence, atomicity, and scope; build a trace-based violation oracle.
Read path bypasses the contract¶
Cause: Caches, followers, indexes, search replicas, exports, or background jobs serve state without the required frontier or authority check.
Mitigation: Inventory every observation path, attach contract metadata, and enforce read eligibility or explicit weaker-mode labeling.
Acknowledgment semantics drift¶
Cause: A write success changes from accepted locally to durably ordered or vice versa without a public contract change.
Mitigation: Version acknowledgment meanings and test each response state against durability, visibility, and session expectations.
Clock-dependent overwrite loss¶
Cause: Last-write-wins uses skewed physical clocks and discards a valid concurrent update.
Mitigation: Use causal metadata, bounded clock uncertainty, conflict retention, or domain-specific merge; never assume wall-clock timestamps encode intent.
Quorum arithmetic without membership reality¶
Cause: Nominal read/write set intersection ignores dynamic membership, correlated failure, stale nodes, or multiple epochs.
Mitigation: Bind quorums to versioned membership and term, prove cross-epoch intersection, and fence stale participants.
Session guarantee lost on reroute¶
Cause: The client frontier is not transmitted, a token expires silently, or a failover region cannot satisfy it.
Mitigation: Define portable context, expiry and error behavior, catch-up or redirection rules, and telemetry for session-frontier misses.
Eventual without convergence contract¶
Cause: Replication is asynchronous but no deterministic merge, quiescence condition, repair cadence, or conflict semantics exists.
Mitigation: State the convergence invariant, merge algebra, conflict policy, propagation assumptions, and operational horizon.
Hidden downgrade during partition¶
Cause: The service continues serving or accepting operations under a weaker mode without telling clients.
Mitigation: Use named degradation states, explicit errors or markers, invariant-based operation eligibility, and audit records.
Isolation mistaken for full consistency¶
Cause: A database isolation setting is assumed to cover cross-region replicas, caches, session behavior, or post-commit freshness.
Mitigation: Separate transaction anomalies from replica visibility and test both scopes independently.
Freshness objective reported as guarantee¶
Cause: A percentile lag metric or average replication delay is presented as an absolute bounded-staleness contract.
Mitigation: Declare whether the statement is a hard bound, probability, percentile, or best effort; define violation behavior.
Mixed-mode composition anomaly¶
Cause: Strong and weak operations interact, and clients infer a composite guarantee that neither mode provides.
Mitigation: Model cross-mode histories, constrain eligible data and operations, publish defaults, and test composition.
Semantic migration without compatibility plan¶
Cause: Topology, database, clock, token, merge, or default settings change while clients retain old assumptions.
Mitigation: Version the contract, stage dual semantics, run conformance tests, monitor, communicate, and retain rollback.
History checker overclaims evidence¶
Cause: Captured traces omit operations, use uncertain clocks, or test only a bounded sample but are treated as proof.
Mitigation: Record trace completeness and timing intervals, use conservative classifications, combine testing with design proof, and preserve uncertainty.
Consistency violation repaired but undisclosed¶
Cause: State is reconciled after split brain, but affected clients, decisions, or downstream systems are not identified.
Mitigation: Link repair to audit trails, impact analysis, correction notices, rollback or compensation, and recurrence prevention.
Neighbor distinctions¶
Concurrency Control¶
Concurrency Control governs simultaneous access, critical sections, conflicts, admission, progress, fairness, and transaction isolation. Shared-State Consistency Contract Design governs which values and histories clients may observe across time and copies. Isolation may implement one portion of the contract, but it is not the complete replica, freshness, session, and migration pattern.
Assumption Bounded Distributed Agreement¶
Distributed Agreement establishes one value, order, or leader under declared fault and timing assumptions. A consistency contract may use consensus to enforce strong semantics, but it may instead choose causal, session, bounded-staleness, or eventual-convergence behavior that deliberately permits different observations.
Transactional Atomicity¶
Transactional Atomicity says a bundle commits or aborts together. It does not by itself define what concurrent or remote clients may read, how stale a replica may be, or whether completed operations respect real time.
Nested and Distributed Transaction Coordination¶
Distributed transaction coordination manages participant states, prepare/commit, compensation, closure, and partial failure for one transaction. The new parent owns the persistent observation contract that can govern many transactions and nontransactional operations.
Order-Independent Processing¶
Order-Independent Processing changes operations so reordering and retry do not change the outcome. Commutative or idempotent operations can make weaker consistency safe, but the consistency contract still defines visibility, convergence, freshness, and client semantics.
Reconciliation After Drift¶
Reconciliation After Drift compares and repairs representations after divergence is detected. The new archetype defines which divergence is legal during normal operation, when it becomes a violation, and how clients experience it.
Source-of-Truth Assignment¶
Source-of-Truth Assignment selects an authoritative representation and precedence rule. A shared-state consistency contract may have one or several authorities and must additionally define read/write legality, ordering, staleness, session, partition, and convergence behavior.
Branching and Merging¶
Branching and Merging intentionally creates named parallel versions and governs reintegration. A consistency contract may permit concurrent versions internally, but its primary unit is legal operation history and client observation rather than managed work branches.
Canonical Ordering¶
Canonical Ordering chooses a stable comparison or serialization order. It can support deterministic replay or conflict resolution but does not establish which writes are visible to which readers under concurrency and faults.
Data Integrity Preservation¶
Data Integrity Preservation protects accuracy, consistency, and traceability across the lifecycle. The new archetype is the narrower formal design of concurrent shared-state observation semantics and their cost/enforcement trade-offs.
Observability Instrumentation¶
Observability Instrumentation makes internal state inferable. It supplies telemetry for lag and violations but does not choose or enforce the legal-observation contract.
Examples¶
Multi Region Account Service¶
Balance-changing writes coordinate strongly while profile and activity-feed reads use weaker documented contracts.
Overspend and duplicate withdrawal are invariant failures, while not every derived view needs the same global order.
Offline First Collaboration¶
Mobile devices edit shared sets offline, carry causal context, expose conflicts that cannot be merged, and converge after reconnection.
Temporary divergence is intentional, but causal order, deterministic merge, and user-visible conflict semantics must be explicit.
Inventory And Reservation¶
Reservations require a linearizable conditional decrement, while catalog search tolerates bounded-staleness replicas.
Different operation classes have different anomaly costs and can use governed tunable consistency.
Cache And Session Store¶
Follower or edge reads are allowed only within a freshness bound and session requests carry a frontier to preserve read-your-writes.
Fast local reads are valuable but must not violate the user’s own update sequence.
Configuration And Metadata Service¶
Clients read one committed configuration epoch, and stale controllers are fenced after failover.
Conflicting authority or stale configuration can cause split-brain behavior, so order and fencing are load-bearing.
Industrial Digital Twin¶
Sensor-derived state may be time-bounded stale, but command ownership and safety interlocks require stronger semantics.
Freshness, authority, and command ordering have different safety implications and should be contracted separately.
Distributed Analytics¶
A materialized view publishes its event frontier and refuses to describe itself as current when it falls beyond a five-minute bound.
The contract turns replica or pipeline lag into an honest client-visible freshness promise.
Extended example: regional inventory semantics¶
A retailer operates inventory services in three regions. The original platform uses local writes and asynchronous replication everywhere, described only as highly available and eventually consistent. During a network partition, two regions each confirm the last unit of a regulated product. A later last-write-wins merge erases one reservation, and neither customer service nor auditors can tell which confirmation was authoritative. The redesign starts by separating state and operations. Catalog descriptions and search indexes can tolerate bounded staleness; shopping-cart additions can use session read-your-writes; inventory reservation and release must preserve nonnegative stock and one successful claimant for the last unit. The team writes legal histories for each class, declares the partition and clock model, and rejects a system-wide strongest setting as unnecessary. Reservation writes route through an authoritative quorum with versioned membership and fencing. A successful reservation means durably ordered and visible to strong reads. Catalog reads use a version-lag bound, and the API returns the view frontier. Carts carry a session token across regions. Offline scanners may collect provisional counts but cannot commit final fulfillment. The team injects partitions, stale leaders, delayed acknowledgments, clock skew, and rerouting while a history checker evaluates the appropriate contract. Telemetry records session misses, quorum refusal, stale-read age, conflict rate, and any illegal observation. The migration runs dual reads, translates old version tokens, backfills metadata, observes client behavior, and retains rollback. The result is not one universal consistency level; it is a governed portfolio whose semantics match the invariant and whose costs are explicit.
Linearizable exclusive authority¶
A configuration service gives each controller a term and fencing token. Writes are accepted only by the current leader after quorum commit, and readers that require current authority use a barrier or committed frontier. A stale controller may still be alive, but its older fencing token prevents side effects. The consistency contract is not merely leader election: it states what success means, which reads may use followers, and what happens when a quorum cannot form.
Causal collaboration with offline work¶
A collaborative application lets devices work offline. Each edit carries causal context. When devices reconnect, edits that depend on earlier observations are never shown before those causes. Independent concurrent additions merge automatically, while noncommutative replacements remain siblings for review. Users see whether a document is synchronized, contains unresolved conflict, or is still missing remote context. The contract permits temporary divergence but does not permit invisible data loss.
Bounded-staleness analytics¶
A dashboard is allowed to lag the authoritative event log by five minutes. Every response includes the processed frontier and measured age. If the materialized view exceeds the bound, the service waits, redirects, or returns a stale/unavailable status; it does not continue presenting the view as current. A percentile availability objective is tracked separately from the hard semantic bound.
Tunable commerce platform¶
A commerce platform classifies operations by invariant. Product descriptions and search facets use regional bounded-staleness reads. A user’s cart uses a session token. Inventory reservations use linearizable conditional writes. Order-history projections may converge asynchronously but publish their frontier. The platform prohibits weak reads inside the final reservation decision and records which contract governed every response. Tunability is therefore governed by operation class, not left to arbitrary client choice.
Non-examples¶
- Adding a mutex around one in-memory data structure.
- Running two-phase commit so a multi-step transfer commits or aborts together.
- Electing a leader among replicas without specifying what follower reads may observe.
- Repairing two already-diverged account ledgers through an audit process.
- Naming one database the system of record while leaving cache and client visibility undefined.
- Using a source-control branch and pull request to merge document edits.
- Showing node health and replication throughput without testing client-visible histories.
- Calling every asynchronous replica eventually consistent when no convergence or merge obligation exists.
Practical review questions¶
- What exact state, operations, copies, and clients are covered by the consistency claim?
- What observable histories are legal, and can a checker classify them?
- Which domain anomalies are unacceptable, and at what scope?
- Does the requirement concern order, freshness, session behavior, atomicity, durability, convergence, or several of these?
- What topology, membership, clock, communication, crash, restart, and storage assumptions support the guarantee?
- What does a successful write acknowledgment mean?
- Which replica or frontier may answer each read, and what happens when it cannot?
- What context must a client preserve to receive session or causal guarantees?
- How are concurrent updates rejected, ordered, merged, retained, or escalated?
- What latency, availability, throughput, metadata, and refusal costs does the contract impose?
- Is the selected contract the weakest one that still preserves the real invariant?
- How will partitions, stale leaders, clock skew, restart, reordering, retry, and duplicate delivery be tested?
- Which telemetry measures client-visible legality rather than node health alone?
- What happens when the contract cannot be met: wait, reject, redirect, mark stale, read-only, provisional, or explicit weaker mode?
- How are violations contained, repaired, disclosed, audited, and prevented from recurring?
- How will existing clients and historical data survive a consistency or topology migration?
- Who bears the delay, refusal, conflict, or repair burden, and are those burdens distributed fairly?
Shared-State Consistency Contract Design succeeds when clients, operators, and reviewers can answer a concrete question about any response: under which contract version, assumptions, version frontier, and enforcement path was this observation legal? The product is not the strongest possible setting. It is a truthful and economical semantics boundary that keeps system behavior, domain invariants, and client expectations aligned as concurrency and topology change.
Common Mechanisms¶
- Anti-Entropy Synchronization — A background process that periodically compares replicas and repairs divergence, so any update missed during a fault eventually propagates everywhere.
- Bounded-Staleness Read Policy — Lets reads be served from lagging replicas but caps how far behind the latest write they may be — a time or version bound — trading freshness for latency and availability.
- Causal-Consistency Protocol — Guarantees that reads respect cause and effect — if one operation could have influenced another, every observer sees them in that order — without paying for a global total order.
- Consistency Contract Decision Record — A written record that fixes the chosen consistency contract — scope, guarantee, operation semantics, client-facing promise, and the assumptions behind them — as the single source of truth.
- Consistency History Checker — Records the real interleaving of operations a system produced and mechanically checks whether that history is admissible under the claimed consistency model.
- CRDT-Like State Merge — Represents shared state as data types whose concurrent updates merge deterministically, so replicas accept writes independently and always converge to the same value.
- Hybrid Logical Clock — A timestamp that fuses physical wall-clock time with a logical counter, so events get an ordering that tracks real time yet never contradicts causality despite clock skew.
- Last-Write-Wins Register — Resolves concurrent writes to a single value by keeping the one with the highest version stamp and discarding the rest — deterministic convergence at the cost of silently dropping the losers.
- Leader-Based Replication — Routes every write through a single designated leader that orders it and streams it to followers, giving one authoritative sequence of updates for a piece of state.
- Lease and Fencing-Token Protocol — Grants exclusive access for a bounded, time-limited lease and stamps each protected action with a monotonic fencing token, so a delayed or revived holder is rejected instead of corrupting state.
- Linearizable Read/Write Protocol — Guarantees every read returns the most recent completed write, as if all operations ran one at a time on a single copy in real-time order.
- Multi-Leader Replication with Conflict Resolution — Lets several replicas accept writes independently for local speed, then reconciles the conflicting versions this inevitably produces with an explicit resolution rule.
- Partition and Clock Fault Injection — Deliberately induces network partitions, message delays, and clock skew against a running system to test whether its consistency contract actually holds under the faults it claims to tolerate.
- Quorum Read/Write Protocol — Writes touch W replicas and reads touch R of N so the two sets always overlap (R + W > N), turning consistency, latency, and availability into three tunable dials.
- Read Repair — On each read, compares the versions the queried replicas return and writes the freshest value back to the stale ones, healing divergence opportunistically on the read path.
- Replica-Lag and Freshness Dashboard — Continuously measures how far replicas lag and how stale served reads actually are, and alerts when observed freshness breaches its promised bound or SLO.
- Safe Consistency Migration Workflow — Changes a live system's consistency semantics in reversible, observable stages — dual paths, shadow comparison, staged cutover — instead of flipping the guarantee as a silent config change.
- Sequential-Consistency Trace Protocol — Records the interleaved history of operations and checks it against a single program-order-respecting total order, flagging any execution no such order can explain.
- Session-Guarantee Token — A token the client carries between requests, encoding what it has already observed, so the system can promise read-your-writes and monotonic reads within that one session even over inconsistent replicas.
- Transaction Isolation — Defines which concurrency anomalies a multi-operation transaction is protected from by naming an isolation level and the set of interleavings it rules out.
- Version Vector — Tags each version of a value with a per-replica counter map, so the system can tell whether two versions are causally ordered or genuinely concurrent — and thus in conflict.
Compression statement¶
Define the state and operations; model client-visible histories; declare order, visibility, freshness, session, convergence, and partition obligations; compare their coordination, latency, availability, and metadata costs; select a contract; implement read, write, version, conflict, and recovery rules that can enforce it; publish the semantics to clients; test captured histories under faults; monitor violations and lag; and treat any consistency change as a governed semantic migration.
Canonical formula: C = (S, O, ≺, V, F, G, P); a history h is valid iff h ∈ L(C, A), where S is state scope, O operations, ≺ required order, V visibility, F freshness, G session/convergence guarantees, P partition behavior, and A declared assumptions.
Related Abstractions¶
Abstractions this archetype builds on — directly (a source ingredient) or as a related pattern. Links follow the typed catalog namespace.
Built directly on (4)
- Concurrency: Manage simultaneous processes.
- Consistency Model: An explicit contract over which observations of shared state are legal when updates are concurrent.
- Observability: Infer internal state externally.
- State and State Transition: Captures system condition and evolution.
Also references 14 related abstractions
- Causality: Cause-effect relationships.
- Commutativity: Order of inputs does not affect output.
- Consensus: Producing a single shared decided state from many participants with disagreeing or adversarial views, under a fault model, satisfying agreement, validity, and termination together.
- Consistency: A set of commitments cannot jointly derive a contradiction.
- Data Integrity: Accuracy and consistency preserved.
- Eventual Consistency: Distributed copies of shared state are allowed to diverge under local updates, with a deterministic merge guaranteeing they reconverge once updates stop.
- Fault Tolerance: Continue operating under failure.
- Idempotence: Repetition yields same result.
- Invariance: Properties unchanged under transformation.
- Latency: The irreducible delay between an input and the system's response.
Variants¶
Narrower or domain-specific specializations that share this archetype's core structure. Recognized variants are established; candidate variants are provisional.
Linearizable Consistency Contract · subtype · recognized
Requires each operation to appear atomic at one point between invocation and response, with completed real-time precedence preserved for all clients in scope.
- Distinct from parent: The parent selects among multiple legal-history contracts; this variant chooses the strongest common single-operation contract.
- Use when: A stale or reordered observation could create duplicate authority, overspend, unsafe command, or broken uniqueness; Clients need a single-copy illusion rather than merely eventual convergence; The latency and refusal cost of coordination is acceptable.
- Typical domains: account balances, distributed locks, configuration registry, inventory reservation
- Common mechanisms: linearizable read write protocol, leader based replication, quorum read write protocol, consistency history checker
Sequential Consistency Contract · subtype · recognized
Requires all operations to fit one shared total order that preserves each client or process program order, while allowing that order to differ from wall-clock completion.
- Distinct from parent: It is one guarantee-strength choice inside the parent’s broader contract design.
- Use when: A coherent shared order matters but strict real-time visibility does not; Clients can tolerate an operation becoming visible later than its response suggests; The system can enforce a global order more cheaply without real-time constraints.
- Typical domains: parallel memory models, replicated logs, collaborative state
- Common mechanisms: sequential consistency trace protocol, consistency history checker
Causal Consistency Contract · subtype · recognized
Requires causally related operations to be observed in causal order while permitting concurrent unrelated operations to be seen in different orders.
- Distinct from parent: The parent can choose real-time, total, causal, session, freshness, or convergence obligations; this variant centers causal visibility.
- Use when: Users act on earlier observations and later actions should not appear without their causes; Global total ordering would impose unnecessary coordination; Causal context can be propagated and retained.
- Typical domains: social feeds, collaborative editing, message threads, multi region metadata
- Common mechanisms: causal consistency protocol, version vector, hybrid logical clock, session guarantee token
Session Consistency Contract · subtype · recognized
Provides client-scoped monotonic and read-your-writes guarantees by carrying an observation frontier across requests.
- Distinct from parent: It is a deliberately scoped consistency profile inside the parent.
- Use when: A user must not see their own successful update disappear on the next request; Global strong consistency is too expensive but per-session coherence is sufficient; The client or gateway can retain and transmit a version frontier.
- Typical domains: web sessions, mobile apps, shopping carts, profile settings
- Common mechanisms: session guarantee token, bounded staleness read policy
Bounded-Staleness Consistency Contract · temporal variant · recognized
Allows stale reads only within a measurable time, version, or log-position distance from a declared authoritative frontier.
- Distinct from parent: The parent supports unbounded eventual, session, causal, and total-order contracts; this variant makes staleness a first-class bound.
- Use when: Freshness has a domain-specific tolerance rather than an all-or-nothing latest-value requirement; Replica lag can be measured against a reliable frontier; The system can wait, redirect, or fail when the bound is exceeded.
- Typical domains: analytics dashboards, catalog search, monitoring views, edge caches
- Common mechanisms: bounded staleness read policy, replica lag dashboard, hybrid logical clock
Eventual Consistency with Deterministic Merge · temporal variant · recognized
Allows replicas to diverge during local updates and requires them to converge to equivalent state after communication resumes and updates quiesce, using deterministic merge semantics.
- Distinct from parent: The parent selects the contract; this variant chooses convergence after quiescence rather than immediate single-copy visibility.
- Use when: Local writes during disconnection or partition are valuable; Temporary divergent observations are acceptable and disclosed; The data type or domain has a defensible deterministic merge rule.
- Typical domains: offline first apps, collaborative sets, edge collection, distributed counters
- Common mechanisms: crdt like state merge, version vector, anti entropy synchronization, read repair
Tunable or Operation-Scoped Consistency · implementation variant · recognized
Allows different operations, data classes, or requests to select different consistency strengths under a governed compatibility and invariant policy.
- Distinct from parent: The parent may establish one fixed contract; this variant governs a portfolio of contracts and their interactions.
- Use when: Some data or operations require strong invariants while others prioritize latency or availability; Clients can select semantics without creating incoherent mixed histories; The platform can validate cross-mode interactions and defaults.
- Typical domains: multi model databases, commerce platforms, metadata and content services
- Common mechanisms: quorum read write protocol, transaction isolation, consistency contract decision record
Near names: Consistency Contract Selection, Client-Visible Consistency Design, Replica Consistency Contract, Read/Write Consistency Policy, Linearizability Policy, Session-Guarantee Design, Eventual-Consistency Design, CAP Trade-Off Design.