RDS for PostgreSQL: Multi-AZ or a read replica?
When to choose Multi-AZ, a read replica, or both on RDS for PostgreSQL. What to check in the Spain Region and how to measure failover.
Imagine two situations. In the first, the PostgreSQL instance that handles writes fails and your application stops issuing invoices. In the second, the database stays available, but the month-end report competes for resources with normal product operations. If you need RDS to fail over automatically when the instance fails, evaluate Multi-AZ. If reporting is the problem, consider a read replica, provided the reports can use slightly out-of-date data.
Before asking for a quote, agree on which workflow must resume after a failure, how much downtime it can tolerate, and which queries can use out-of-date data. If writes are already slow, first measure whether the slowdown comes from reporting queries, locks between transactions, or another bottleneck. Adding read capacity alone will not resolve contention between writes.
What you get with each configuration
| Configuration | What it addresses | What serves reads | What takes over writes if the primary fails | What it leaves unresolved |
|---|---|---|---|---|
| Single-AZ instance | A starting point if the business accepts the risk and does not need to offload reads. | The primary instance. | There is no Multi-AZ standby to fail over to. | Keeping writes available if the primary is lost. |
| Multi-AZ instance with one standby | Automatic failover for the failures it covers. | The primary; the synchronous standby in another Availability Zone does not serve queries. | RDS fails over to the standby. | Offloading demanding queries from the primary. |
| Read replica added to an instance | Offloading queries that can tolerate asynchronous replication lag. | The replica serves the queries the application sends to it. | The added replica is not an automatic failover target for the primary. If the instance is Multi-AZ, its own standby fills that role. | Reading changes immediately and, on its own, providing automatic failover for writes. |
| RDS Multi-AZ DB cluster | Automatic failover and read capacity: one writer and two readers across three Availability Zones in the same Region. | During normal operation, the built-in readers handle connections to the reader endpoint. | RDS promotes one of the built-in readers to writer. | Guaranteed reads of the latest change and recovery from the loss of the Region. |
If you only need to restore writes after a covered failure, start by comparing Single-AZ with a Multi-AZ instance. If you have shown that you also need to offload reporting, compare a Multi-AZ instance plus a separate read replica with an RDS Multi-AZ DB cluster. Either configuration can meet both needs, but in the first, the standby and the replica serve different purposes. Promoting the separate replica to a standalone instance is a different recovery decision from failing over to the standby. The cluster in this comparison is RDS for PostgreSQL, not Aurora.
Which queries can you move off the writer?
In the invoicing example, use the writer both to issue the invoice and to run the query that must show it as soon as it is saved. A month-end report can go to a reader if the people using it accept the lag and know when the data is too old to base a decision on. Set that limit with the team that uses the report and check it under load. If the lag exceeds the limit, decide in advance whether to defer the query or warn users that the data is not yet up to date.
The cluster's semisynchronous replication requires at least one reader to acknowledge the change before the writer commits the transaction. That does not mean the reader your application connects to has already applied it. Use the reader endpoint for read-only queries: a specific instance handles each connection. During failover, that endpoint can briefly route connections to the new writer. Measure the lag your queries see, not just whether the reader responds.
How to compare costs in your Region
Use two columns in your estimate:
- Monthly AWS cost. Use the RDS for PostgreSQL pricing page and calculator for the exact Region, deployment option and instance classes. Include compute and storage, input/output operations per second (IOPS) if billed separately, and backups and data transfer where applicable. Include the read replica if you add one. Use the same workload and retention settings for each option, and record the date, currency and assumptions. A pricing example from another Region is not a quote for Spain.
- Team effort. Estimate separately the work to change how the application connects, run the failover test and monitor lag, and identify who will respond to alerts. If the team cannot maintain two connection paths, that effort matters even if the monthly cost fits the budget.
If you operate in Europe (Spain), eu-south-2, the AWS support matrix for Multi-AZ DB clusters lists the Region for supported PostgreSQL versions. Before committing to the spend, confirm the exact engine version and instance class combination, the subnets in the required Availability Zones, and whether the extensions and backups you use are supported. For example, a Multi-AZ DB cluster does not support cross-Region automated backups. If you rely on that feature, compare the alternatives before making the change.
You can make the same comparison in your current European Region. Using Multi-AZ within one Region does not demonstrate that you can recover if you lose that Region. If that is the failure you need to cover, see how to choose between the AWS Spain Region and a second Region.
What to require from a failover test
For direct connections, RDS updates the DNS target when a Multi-AZ instance or a Multi-AZ DB cluster fails over. You need to re-establish existing connections. An RDS event recording a change of primary does not prove that the application's critical workflow has recovered.
Run the test in a representative environment, with an agreed test window, someone in charge, and a clear condition for stopping. Before you start, agree with the business on the maximum acceptable downtime and what counts as a stable recovery. Use test operations you can trace end to end.
- Record the RDS events and use the application to record the first workflow failure, the first successful write after failover, and the point from which the workflow runs reliably again. Check the business outcome as well as the database response: for example, confirm that the test invoice was recorded and can be retrieved.
- Check that the application's connection pool discards broken connections and opens new ones to the updated target. Review DNS caching, timeouts and the retry limit. If the connection drops before the application receives a response to a write, the database may already have committed it. Check what happened and require that retrying the operation with the same identifier does not issue a second invoice.
- If you use readers, check whether reports remain available and whether their data is recent enough during and after the change. In a cluster, also check whether reporting traffic reaches the new writer and how that affects the critical workflow. Record the failures: the first successful write is not enough to pass the test.
Failover cannot return the database to its state before an accidental deletion. For an RDS instance, point-in-time recovery creates a new instance. That calls for a separate test with its own acceptance criteria. This comparison does not include an actual quote or test results from an AWS account. Use your own estimate and test to determine the costs and recovery times for your workload.
Write down the decision
One page is enough. Record the option you chose and the one you ruled out, the failure it covers, the maximum acceptable downtime and lag, costs and assumptions, who is responsible, and the test that will determine whether the change can go ahead. Note what would make you revisit the decision: for example, if reports can no longer tolerate the lag or the invoicing workflow misses the agreed recovery threshold.
If you need to compare configurations for your workload and define what tests to require before making a change, see the AWS cloud architecture and design service. The design scope covers comparing options, estimating their costs with stated assumptions, and outlining a phased change.
Alejandro Rodríguez
Freelance Cloud & DevOps Consultant, Madrid