Key takeaway
- Data consistency explained: strong vs eventual consistency in distributed databases, consistency as a data quality dimension, and how to govern both.
Data consistency means two related things, and enterprise teams need both. In distributed databases, it is the guarantee about what a read returns after a write: strong consistency always returns the latest committed value, while eventual consistency lets replicas disagree for a short time and converge later. In data quality, consistency is a dimension that asks whether the same fact agrees with itself across records, systems and business rules.
The first meaning is an architecture choice you make per workload; the second is a property you measure and fix. Payments, ledgers and regulatory reporting need strong guarantees and reconciliation checks. Catalogues, feeds and dashboards can usually accept eventual consistency, provided you know how stale the data can get and you test that copies match.
This guide covers the database meaning first, then the data quality meaning, then how to govern both. For the wider set of quality problems, such as missing, duplicate and outdated records, see our guide to data quality issues and how to fix them.
What does data consistency mean?
The same term is used by database engineers and by data quality teams, and the two conversations often talk past each other. The table separates them.
| Meaning | Question it answers | Who owns it | How you control it |
| Consistency in distributed systems | After a write, which value can a reader on any node or region see? | Architects, platform and database teams | Consistency level per database or request, replication mode, transactions |
| Consistency as a data quality dimension | Does the same fact agree across records, systems and rules? | Data owners, data stewards, data engineering | Rules, reconciliation checks, master data, data contracts |
| Consistency in ACID transactions | Does each transaction move the database from one valid state to another? | Application and database teams | Constraints, keys and transaction logic |
The meanings are linked. Weak guarantees in the database layer, such as a reader seeing a stale replica, show up later as quality defects: a customer address that differs between the CRM and the billing system, or a stock level that does not match the order history.
How do strong and eventual consistency differ in distributed databases?
A consistency model is a contract about which results a system is allowed to return. Jepsen describes it as "a safety property which declares what a system can do". The strongest single-object model, linearizability, means every operation appears to take effect atomically at one moment, in an order that matches real time. Jepsen notes that linearizability cannot be totally available: during a network partition, some nodes must stop serving requests to keep the guarantee. That is the practical trade-off behind the CAP theorem.
Eventual consistency makes the opposite trade. Writes are accepted locally and replicated in the background, so reads stay fast and available, but a reader may see an older value until the replicas converge. Most managed databases now let you choose between these positions rather than forcing one.
Which consistency levels do major cloud databases offer?
| Database | Options | What to know (current status) |
| Amazon DynamoDB | Eventually consistent reads (default) or strongly consistent reads with ConsistentRead |
Eventually consistent reads are half the cost of strongly consistent reads. Reads from global secondary indexes and streams are always eventually consistent. Global tables offer multi-Region eventual consistency (default) or multi-Region strong consistency, where a write is synchronously replicated to another Region before it returns. |
| Azure Cosmos DB | Five levels: strong, bounded staleness, session, consistent prefix, eventual | Strong offers linearizability. Session gives read-your-writes within one client session. Accounts with multiple write regions cannot use strong consistency. |
| Google Cloud Spanner | External consistency for serializable transactions | Google describes external consistency as stricter than serializability and stronger than linearizability, using the TrueTime distributed clock to timestamp transactions. |
The middle levels matter in practice. Bounded staleness caps how far a replica can lag, and session consistency guarantees that a user sees their own writes even when other users may briefly see older data. For many customer-facing applications, these give most of the benefit of strong consistency at lower latency.
When should you choose strong, session or eventual consistency?
| Workload | Fits | Why |
| Payments, ledgers, inventory reservations, entitlements | Strong consistency or serializable transactions | A stale read can cause a double spend, oversell or wrong access decision |
| User profiles, shopping baskets, settings | Session consistency or read-your-writes | The user must see their own change; others can lag briefly |
| Dashboards, reporting replicas, near-real-time analytics | Bounded staleness or eventual with a stated lag | Freshness matters, but a known delay is acceptable |
| Feeds, catalogues, recommendations, search indexes | Eventual consistency | Availability and low latency matter more than instant agreement |
How is consistency measured as a data quality dimension?
In data quality, consistency is one of the characteristics in the ISO/IEC 25012 data quality model, alongside accuracy, completeness, credibility and currentness. The standard places it with inherent quality, which concerns the data itself, including the "relationships of data values". In plain terms, data is consistent when it does not contradict itself across records, sources or rules.
Consistency is different from accuracy. Two systems can agree perfectly and both be wrong. A consistency check proves that copies and related values line up; an accuracy check proves they match the real world. Teams usually need both, and they report them as separate data quality metrics.
| Type of check | Example | Where it runs |
| Cross-system reconciliation | Order totals in the source system match totals in the warehouse for the same day | After each load or on a schedule |
| Replica comparison | Row-by-row comparison of source and target after migration or replication | During migration and ongoing replication |
| Referential consistency | Every order references a customer that exists | In the pipeline and in database constraints |
| Cross-field rules | Ship date is not earlier than order date; country matches currency | At ingestion and in transformation tests |
| Format and code consistency | The same product code, unit and date format in every system | At ingestion, enforced by reference and master data |
These checks belong in a wider data quality management programme, with an owner for each critical data element and a threshold that triggers action.
What causes inconsistent data across systems?
Most consistency failures trace back to a small set of causes. Each one has a known control.
| Cause | What goes wrong | Control |
| Redundant copies | Every copy must receive every update; a missed update leaves copies diverged | One system of record per entity, CDC to copies, reconciliation |
| Replication lag | Readers on different nodes or regions see different versions | Choose the consistency level per workload; monitor lag |
| Dual writes | An application writes to a database and a message broker; one succeeds and the other fails | Transactional outbox or log-based CDC |
| Schema changes | Producers and consumers interpret fields differently during a rollout | Versioned schemas, compatibility rules, data contracts |
| Concurrent writes | Lost updates or overwritten records when two writers change the same item | Transactions, conditional writes, conflict resolution rules |
| Manual and batch fixes | A correction in one system is never applied to the others | Fix at the source and let changes flow downstream |
Which patterns and tools keep systems in sync?
No single pattern covers every workload. The decision table lists the main options and their trade-offs.
| Pattern | What it does | When it fits | Trade-off |
| Primary-replica replication | Writes go to one primary and are copied to read replicas | Read-heavy reporting and analytics | Replicas can serve stale reads during lag |
| Two-phase commit (2PC) | A coordinator asks all participants to vote, then commits or aborts everywhere | Atomic changes across a few databases that support it | Adds latency; a coordinator failure can leave participants blocked |
| Transactional outbox | Stores the outgoing event in the same database transaction as the business change; a relay publishes it | Microservices that must update a database and publish an event | Consumers must handle duplicate events |
| Change data capture (CDC) | Reads the database transaction log and streams each committed change | Keeping warehouses, caches, search indexes and services in step with a source | Copies are eventually consistent; lag must be monitored |
| Sharding | Splits data into partitions managed separately | High-volume workloads with clear partition keys | Cross-shard transactions and queries are harder to keep consistent |
The transactional outbox pattern exists because 2PC is often not an option: the database or broker may not support it, and coupling a service to both is undesirable. Saving the event in the same transaction as the data removes the dual-write gap.
Debezium, AWS DMS and Apache Kafka
Debezium is a set of distributed services that capture database changes and record row-level changes as an ordered change event stream. Its documentation lists 3.7 as the latest stable release, with source connectors for MySQL, MariaDB, PostgreSQL, MongoDB, Oracle, SQL Server, Db2, Cassandra, Spanner and others. It runs on Kafka Connect, or as Debezium Server, which does not require Kafka.
AWS Database Migration Service reads ongoing changes from the source engine's transaction logs during full load plus CDC or CDC-only tasks. AWS states plainly that DMS CDC "does not provide real-time replication" and that there are no SLAs for CDC latency, so plan for lag. Its data validation feature compares each source row with its target row and reports mismatches, which turns a consistency assumption into a measured result.
Apache Kafka is the common transport for CDC events. If you run it yourself, note that Kafka 4.0 supports only KRaft mode: ZooKeeper mode has been removed, and ZooKeeper clusters must migrate to KRaft before upgrading.
What has changed in data consistency since 2024?
- Strong consistency across regions is now a managed option. DynamoDB global tables offer multi-Region strong consistency alongside the eventual default, so teams can choose per table instead of building their own coordination.
- Kafka dropped ZooKeeper. Self-managed CDC pipelines on Kafka 4.x run on KRaft only.
- CDC no longer needs Kafka. Debezium Server streams changes without a Kafka cluster, which lowers the cost of keeping smaller systems in sync.
- AI agents raise the stakes. An agent that reads a customer record from one store and an order from another can act on two versions of the truth. In our own agent work, we keep an agent's working memory in one store that pushes changes to readers, rather than syncing separate stores and living with eventual consistency bugs. We also use a shared metadata layer so storage and compute see the same definitions, and CDC to keep downstream copies current.
How should enterprise leaders govern data consistency?
Consistency is a business decision before it is a technology setting. The useful question is not "are our systems consistent?" but "how stale can this data be, for this decision, and how would we know?"
- Set a consistency requirement per data domain. Record the required model (strong, session, bounded, eventual) and the maximum acceptable lag, next to the owner, in your data governance catalogue.
- Name one system of record per entity. Every other copy is derived from it through CDC or events. Fixes happen at the source.
- Monitor replication lag and reconciliation results. Treat a breached lag threshold or a failed reconciliation like any other production incident, using the same data observability signals you use for freshness and volume.
- Account for cost and latency. Strong reads cost more in DynamoDB, and strong consistency across write regions adds latency or is not available, as in Cosmos DB. Pay for strong guarantees where the business risk justifies it.
- Secure the change stream. CDC streams carry every committed change, including personal data. Apply the same access control, masking and retention rules as the source tables.
- Govern what AI agents read. Agents should read from the system of record or a copy with a known lag, and record which version of the data they used for each decision. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents.
Consistent data also makes self-service analysis trustworthy: when two dashboards answer the same question differently, users stop trusting both. AgentAnalyst lets teams ask questions of enterprise data in plain language and get real-time insights, which works best on reconciled sources. For help designing the underlying platform, see our data management services.
In what order should you adopt a data consistency strategy?
- Inventory critical entities. List customers, orders, products, accounts and the systems that hold a copy of each.
- Choose the system of record for each entity and remove direct writes to copies.
- Classify workloads using the strong, session, bounded or eventual table above, and set the database consistency level to match.
- Replace dual writes with the transactional outbox or log-based CDC.
- Add reconciliation and cross-field checks to pipelines, starting with financial and regulatory data.
- Monitor lag and check results with alerts and owners, then report consistency as a quality metric.
- Extend to AI workloads so agents and models read from governed, reconciled sources.
When is strong consistency the wrong choice?
Strong consistency is not free. It adds write latency, reduces availability during network partitions, and costs more per read in some managed services. It is the wrong default for feeds, search indexes, recommendation data and most analytics replicas, where a short, known delay does no harm.
Eventual consistency is the wrong choice when a stale read leads to an irreversible action: moving money, reserving scarce stock, granting access or filing a regulatory report. It is also risky when nobody monitors lag, because "eventually" then has no upper bound. If you cannot state the maximum acceptable delay for a dataset, you are not ready to accept eventual consistency for it.
To map one decision your agents make, and which data and consistency guarantees it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions about data consistency
What is data consistency?
Data consistency has two meanings. In distributed databases, it defines which value a read returns after a write, from strong consistency (always the latest committed value) to eventual consistency (replicas converge over time). In data quality, it means the same fact does not contradict itself across records, systems or rules.
What is the difference between strong and eventual consistency?
Strong consistency guarantees that every read returns the most recent committed write. Eventual consistency allows replicas to return older values for a time, in exchange for lower latency and higher availability. In DynamoDB, eventually consistent reads are the default and cost half as much as strongly consistent reads.
Is data consistency the same as data accuracy or data integrity?
No. Consistency means copies and related values agree with each other. Accuracy means they match the real world, so two systems can be consistent and both wrong. Integrity usually refers to constraints and keys that keep data valid, which supports consistency but does not replace reconciliation across systems.
How do you check data consistency across systems?
Use reconciliation of totals and counts between source and target, row-by-row comparison after replication (AWS DMS data validation does this), referential checks, and cross-field rules. Run them after each load or on a schedule, and alert an owner when a threshold is breached.
Can Azure Cosmos DB use strong consistency with multiple write regions?
No. Microsoft states that Cosmos DB accounts with multiple write regions cannot use strong consistency. Those accounts choose from bounded staleness, session, consistent prefix or eventual consistency.
Does change data capture give real-time consistency?
Not on its own. CDC tools such as Debezium and AWS DMS read committed changes from the transaction log, so downstream copies are eventually consistent. AWS states that DMS CDC does not provide real-time replication and has no latency SLA, so monitor lag and reconcile results.
Ready to put AI agents to work? Explore ElixirClaw, the agentic OS platform to build, orchestrate and govern AI agents.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE