- Newest
- Most votes
- Most comments
Your understanding of Aurora PostgreSQL's replication mechanism is on the right track, but let's clarify a few points to address your concerns about potential stale data.
In Aurora PostgreSQL, all instances (both the writer and the read replicas) indeed share the same underlying storage volume. This shared storage architecture is fundamental to Aurora's design and contributes to its high performance and low replication lag. However, it's still possible to have some lag, albeit minimal in most cases.
The ReplicaLag metric in Aurora PostgreSQL has a specific meaning that differs from traditional PostgreSQL replication. It doesn't indicate that the data in the replica is lagging behind in the traditional sense. Instead, it refers to the lag in the page cache of the Aurora Replica compared to the writer instance.
Here's what this means in practice:
- The underlying data in the shared storage is always up-to-date across all instances.
- Each instance (writer and replicas) maintains its own page cache in memory for faster data access.
- The ReplicaLag metric indicates how far behind a replica's page cache is compared to the writer's page cache.
In most cases, this lag is minimal (usually less than 100 milliseconds) and doesn't typically result in stale data being read. However, during periods of high write activity, you might see an increase in this lag.
When a connection performs a SELECT on a replica:
- If the data is already in the replica's page cache, it will be returned immediately.
- If the data is not in the cache, the replica will read from the shared storage, which always has the most up-to-date data.
This means that in the vast majority of cases, you won't see stale data when querying a replica, even if there is some reported ReplicaLag. The lag primarily affects the performance of reads that aren't cached, rather than the accuracy of the data.
However, in extremely rare cases during very high write loads, it's theoretically possible that a read could return slightly stale data if it reads from the cache before the cache is updated. This scenario is uncommon due to Aurora's efficient cache invalidation mechanisms.
For your event-driven architecture, the risk of reading stale data is very low. Nevertheless, if you have specific transactions that absolutely must read the most up-to-date data, you can direct those to the writer instance. For the majority of read-only queries, using the reader endpoint should provide excellent performance without significant concerns about data staleness.
Sources
Replication with Amazon Aurora PostgreSQL - Amazon Aurora
Replication with Amazon Aurora - Amazon Aurora
Replication with Amazon Aurora MySQL - Amazon Aurora
Relevant content
- AWS OFFICIALUpdated 9 months ago

Thank you very much.
I accepted the answer before the Expert Review, but I am more at ease now that it was reviewed.
Nonetheless, it confirmed my suspicions. I believe we will not have issues but in any case I am suggesting the developers to explicitly use the connection to the writer instance in case of any concern.