Cloud concept · Updated

Eventual Consistency - Eventual consistency is a distributed-data model in which replicas may temporarily return different values but converge if updates stop and replication completes successfully.

In short

A successful write does not necessarily become visible immediately through every replica or read path. This model supports asynchronous replication and scalable reads, but engineers must account for stale results, replication lag, and possible data loss when failing over to an asynchronous replica.

Cloud Concepts Hub →

6 key aspects of Eventual Consistency

Eventual consistency exchanges immediate agreement across replicas for more flexible replication and read scaling, requiring deliberate freshness, conflict-resolution, cost, and failover decisions.

01
Convergence rather than immediate agreement

Replicas may temporarily disagree, but they converge after updates stop and replication and conflict resolution complete successfully. Eventual consistency alone provides no fixed deadline for that convergence.

02
Read scaling with freshness trade-offs

Asynchronous read replicas can offload browsing, reporting, and other stale-tolerant queries from a writer. Route queries deliberately and size replicas to handle both replication work and application reads.

03
Explicit read-after-write handling

A read immediately after a successful write can return an older value through a replica. Use an authoritative read path or a supported stronger consistency option when the workflow requires immediate visibility.

04
Lag-aware failover

Promoting an asynchronous replica can lose acknowledged writes that have not reached it. Match replication and failover choices to recovery point and recovery time objectives, and prevent competing writers during recovery.

05
Operational and cost considerations

Monitor replication lag, replication errors, replica utilization, and query latency. Additional replicas add cost and may improve read throughput, but they do not eliminate writer bottlenecks or guarantee fresher results.

06
Conflict resolution for multiple writers

When multiple replicas accept writes, concurrent changes need a defined resolution policy. Convergence does not by itself guarantee that the winning value satisfies application rules such as preserving inventory or account balances.

Cloud services for Eventual Consistency

These services illustrate different implementations of replica freshness rather than components that must all be deployed together. RDS read replicas and Aurora readers can offload suitable queries while applications retain writer access for freshness-sensitive workflows. Cross-Region replicas introduce recovery decisions that must account for replication lag and potential data loss. DynamoDB exposes consistency choices through read options and global-table configuration. Across these services, separate read-scaling requirements from high-availability requirements, monitor the relevant replication metrics, and test application behavior during stale reads and failover. Stronger consistency options and replica costs differ by service and topology.

Amazon RDSAmazon RDS

RDS read replicas generally use asynchronous replication and can return stale data while offloading reads from a source database. Traditional RDS Multi-AZ DB instance deployments instead use synchronous replication to a standby that does not serve application reads; do not confuse this topology with read replicas or Multi-AZ DB clusters.

Amazon AuroraAmazon Aurora

Aurora Replicas share cluster storage, but reader visibility can still lag the writer, so applications must account for stale reads. Aurora Global Database uses asynchronous cross-Region replication; an unplanned cross-Region failover can lose changes that have not reached the secondary Region.

Amazon DynamoDBAmazon DynamoDB

DynamoDB uses eventually consistent reads by default, while tables and local secondary indexes also support strongly consistent reads; global secondary indexes support only eventually consistent reads. Global tables offer multi-Region eventual consistency and, in supported configurations, multi-Region strong consistency, so verify the selected mode rather than assuming all cross-Region replication behaves identically.

Eventual Consistency exam questions

Real practice exam questions on Eventual Consistency, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C02

A pricing application stores each product's price and an increasing version number in the same row in Amazon RDS for MySQL. Each price update atomically changes the price and increments the version. After the transaction commits, the application sends the product ID and committed version to a document-generation worker.

The worker must read from an asynchronous read replica to avoid adding read load to the primary. It must use the price from the specified version or a later version, never an older version. If suitable data is not available within 10 seconds, the worker can defer processing. Products are not deleted, and each worker query runs in a new autocommit transaction.

Which implementation meets these requirements?

Show answerCORRECT ANSWER

Retrieve the price and version together from the replica. Use the price only if the returned version is at least the version in the message; otherwise, retry until the 10-second deadline and then defer processing.

The version check verifies the freshness of the actual data returned. Because the price and version change atomically in the same row, an acceptable version identifies an acceptable price. New autocommit transactions allow retries to observe newly replicated changes. Deferring at the deadline avoids returning stale data when replication takes longer than expected.

SAP-C03

A financial services company is migrating a PostgreSQL application to AWS. The application uses PostgreSQL stored procedures and multi-table ACID transactions that must remain unchanged. Most database activity consists of read-only customer-history queries that can tolerate replication lag. However, after a payment transaction commits, any application instance that retrieves the payment status must immediately see the committed result. These status queries start new database transactions.

Load testing shows that one appropriately sized database instance can handle all writes and payment-status queries, but cannot also handle the customer-history queries. The database must automatically recover from an Availability Zone failure without losing acknowledged transactions. The company wants to minimize ongoing database administration.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Deploy Amazon RDS for PostgreSQL as a Multi-AZ DB instance deployment. Create read replicas for customer-history queries. Route writes and payment-status queries to the primary DB instance endpoint, and route customer-history queries to the read replica endpoints.

The Multi-AZ DB instance deployment provides synchronous standby replication and managed automatic failover for Availability Zone failures. Separate, asynchronously replicated read replicas offload customer-history queries. Directing new payment-status transactions to the primary avoids stale results caused by replica lag. RDS also manages routine database administration while preserving PostgreSQL functionality.

SAA-C03

A company runs a seasonal application on an Amazon RDS for MySQL DB instance. After the busy season, the company creates a smaller read replica to replace the oversized primary and reduce ongoing database costs. Load testing confirms that the smaller instance can support the entire off-season workload.

The replica is receiving changes asynchronously, and replication lag occasionally exceeds 30 seconds. The company plans to promote the replica and delete the original primary. The application can pause writes during a maintenance window, but every transaction acknowledged by the original primary must be preserved. No additional database instances should be created.

Which cutover procedure meets these requirements?

Show answerCORRECT ANSWER

Pause application writes and allow in-flight transactions to finish. Verify that the replica has applied all transactions through the primary's final committed replication position. Promote the replica, redirect the application, and validate the cutover before deleting the original primary.

Asynchronous replication allows the primary to acknowledge transactions before the replica applies them. Stopping writes and verifying that the replica has applied the final committed transaction prevents data loss during promotion. Promoting the tested smaller instance and retiring the oversized primary achieves the intended cost reduction without adding instances.

Practice Eventual Consistency in a full exam

Questions on Eventual Consistency in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Eventual Consistency

2 min read

Eventual consistency allows copies of data to differ temporarily while updates propagate. If no new updates occur and the replication and conflict-resolution mechanisms operate successfully, replicas eventually agree. The model alone does not specify a maximum convergence time, guarantee that a client immediately sees its own writes, or guarantee that successive reads return increasingly recent data.

In a common cloud database architecture, applications write to a primary database while read replicas receive changes asynchronously. The primary can acknowledge a transaction before a replica has applied it. A customer who changes a delivery address and immediately reads from a replica might therefore see the previous address even though the update succeeded. This is stale data, not necessarily a failed transaction.

Read replicas are useful for read-heavy workloads such as product browsing, reporting, and historical dashboards when some staleness is acceptable. Moving these queries away from the writer can reduce contention and improve throughput. Applications generally need to route eligible queries to replica endpoints explicitly or through a suitable routing layer; adding replicas does not automatically distribute every application's reads. Replicas do not directly increase the writer's transaction-processing capacity.

Choose replica capacity and placement according to query load, acceptable lag, latency, and failure-isolation requirements. An undersized replica or a long-running query can delay replication. Additional replicas also incur compute, storage, I/O, and potentially data-transfer costs. Read replicas can be cost-effective compared with scaling a writer solely to serve reads, but they are not automatically the cheapest solution. Measure utilization and replication lag before adding capacity.

For workflows that require immediate visibility, route the relevant read to the authoritative writer or use an explicitly supported strongly consistent read path. After updating an address, for example, the application can read that customer's record from the writer rather than an arbitrary replica. Inventory reservations and financial decisions often require transactions or conditional writes against authoritative state; retrying a stale read alone does not enforce a business invariant. A fixed delay after writing is also not a correctness guarantee because lag varies.

Asynchronous replication also affects disaster recovery. If the primary fails before acknowledged updates reach a replica, promoting that replica can lose those updates. Evaluate this exposure against the recovery point objective, and evaluate detection, promotion, endpoint changes, and client reconnection against the recovery time objective. Planned transitions should wait for replication to catch up when possible. Failover procedures should prevent the old primary from continuing to accept writes independently.

Do not equate a read replica with a synchronous high-availability standby. A standby may exist primarily for automatic failover and may not accept application reads, whereas a read replica commonly serves read scaling and may require a separate promotion workflow. Exact behavior depends on the database and deployment topology. Likewise, eventual consistency is not the same as transaction isolation, and asynchronous replication is a mechanism rather than a complete consistency guarantee. Multi-writer designs additionally need conflict resolution so concurrent updates can converge predictably.

Learn Eventual Consistency in lessons

5 short lessons on Eventual Consistency in 3 certification courses.

Open the lessons