Sub topic 16
Cost, complexity and when not to use active-active
This chapter assumes you have read the earlier chapters on RTO and RPO, replication, conflict resolution, failover, and capacity planning. Here you weigh what active-active costs against what it gives you, and learn to recognize workloads where a simpler design is the better engineering choice.
Where the cost comes from
Active-active costs more than a single region in four ways.
- Compute headroom. Each region must absorb traffic from a failed region, so you provision more than you use on a normal day.
- Data. Every region stores a full or partial copy, and replication traffic crosses region boundaries, which cloud providers usually bill per GB.
- Engineering effort. Conflict handling, idempotency, routing, and failover logic all have to be designed, built, and tested.
- Operations. More regions mean more deployments, more dashboards, more on-call scenarios, and more failure modes.
The first two are easy to estimate. The last two are usually underestimated, and they usually dominate.
Estimating the infrastructure bill
Headroom depends on how many regions you run and how many losses you must survive. If you must survive the loss of one region, the remaining n - 1 regions must carry the whole peak load.
def provisioned_capacity(peak_load, regions, survive_losses=1):
"""Total capacity to provision so the surviving regions carry peak_load."""
surviving = regions - survive_losses
if surviving < 1:
raise ValueError("cannot survive that many losses with this many regions")
per_region = peak_load / surviving
return per_region * regions
def replication_transfer_cost(gb_written_per_day, regions, price_per_gb):
"""Each write is sent to every other region. price_per_gb is an example value."""
return gb_written_per_day * (regions - 1) * price_per_gb * 30
for n in (2, 3, 4):
total = provisioned_capacity(1000, n)
print(f"{n} regions: {total:.0f} units provisioned for 1000 units of peak load")
print(f"Transfer per month: ${replication_transfer_cost(500, 3, 0.02):,.2f}")The output shows 2000 units for two regions, 1500 for three, and 1333 for four. Adding regions lowers the headroom percentage but multiplies the data copies, the transfer volume, and the number of things that can fail. Three regions are a common compromise for this reason.
The model leaves out two real costs: database capacity (often not elastic, so it is provisioned at peak) and the duplicated fixed costs of load balancers, NAT gateways, monitoring, and logging in each region.
Costs that do not show up on the invoice
- Slower delivery. Every schema change must work while two versions of the code run in different regions, and while replication carries old and new row shapes.
- Harder debugging. A bug report now needs the region, the replication state, and the order in which writes arrived.
- Higher skill requirements. Engineers must understand consistency models, not just APIs. A team that cannot explain why last-writer-wins lost an update is not ready to run it.
- Testing cost. Failure drills, game days, and chaos experiments must run regularly, or the failover path will break without anyone noticing.
The alternatives
Active-active is one point on a range. The table gives typical orders of magnitude, not guarantees. Your actual numbers depend on the database, the data volume, and how well you have rehearsed.
| Strategy | Typical RTO | Typical RPO | Relative cost | Main complexity |
|---|---|---|---|---|
| Single region, multiple zones | Minutes (zone failure only) | Near zero within the region | 1x | Low. Does not survive a regional outage |
| Backup and restore | Hours | Hours (last backup) | Slightly above 1x | Low. Restore must be rehearsed |
| Pilot light | Tens of minutes to hours | Seconds to minutes | About 1.1 to 1.3x | Medium. Scale-up path in the second region |
| Warm standby | Minutes | Seconds to minutes | About 1.3 to 1.8x | Medium. Promotion and failback |
| Active-active | Seconds to minutes | Near zero to seconds | About 2x or more | High. Conflicts, routing, idempotency |
Warm standby deserves attention. It meets the RTO and RPO of most business applications at a fraction of the effort, because there is exactly one writer and therefore no conflict handling at all.
When active-active is justified
Active-active earns its cost when at least one of these is true and cannot be met more cheaply.
- The RTO is close to zero. Minutes of downtime cost more than the whole design. Examples are payment authorization and real-time trading.
- Users are spread globally and latency matters. Serving reads and writes near the user changes the product experience, not just the failover story.
- A regional failover must never be a manual or untested event. Because every region carries traffic daily, the failover path is exercised constantly. A standby region that has not served traffic in months may not work when needed.
- The data model suits it. Writes can be partitioned by owner, or the data is mergeable (counters, sets, append-only events).
When not to use it
Choose something simpler in these situations.
- The service has a strong global consistency requirement with heavy contention. A single shared inventory count, a unique-username check, or a ledger with strict ordering all fight multi-writer replication. You would end up routing those writes to one region, which means you have built active-passive for that data and paid for active-active everywhere else.
- The stated RTO and RPO allow minutes of recovery. Warm standby or pilot light usually meets them.
- The team cannot yet operate one region well. Multi-region multiplies weaknesses. Fix monitoring, deploy automation, and on-call first.
- Dependencies stay single-region. If your identity provider, payment gateway, or a core database is in one region, the whole system still fails with it. Active-active in your own code does not remove that dependency.
- The risk is not regional. Most outages come from bad deploys, expired certificates, and misconfiguration. These replicate to every region at once. Active-active does not protect against them, and it can spread them faster.
A decision flow
Reducing the cost if you proceed
You do not have to make everything active-active.
- Split by tier. Run the stateless edge and read paths active-active. Keep the write path for rarely changed or highly contended data in one region with a warm standby.
- Partition by ownership. Home each customer in one region. Reads can be served anywhere, and writes go to the home region, so conflicts disappear for that data.
- Use three regions, not five. More regions reduce headroom per region but increase transfer cost and failure surface.
- Replicate only what you need. Caches, derived data, and logs can be rebuilt locally rather than copied.
- Automate and standardize. Use the same infrastructure code for every region, so adding or removing one is a parameter change.
- Budget for drills. Treat the regular failure test as part of the running cost, because an untested design is not a reliable one.
A worked decision
Suppose a team runs an internal expense-reporting tool with an RTO of four hours, an RPO of fifteen minutes, and users in two time zones. Active-active would at least double compute cost and add conflict handling for report edits. Warm standby with continuous database replication meets both targets, keeps one writer, and costs far less. The right answer is warm standby.
Now suppose a card-authorization service with an RTO of 30 seconds, global traffic, and per-card writes. Each card can be homed to one region, so conflicts are rare. Idempotency keys handle retries after failover. Here the cost is justified by the revenue lost during minutes of downtime.
Exercise
A team proposes active-active for a service with an RTO of two hours and an RPO of ten minutes. The main data is a global inventory count that every order decrements. Give two reasons to prefer another design, and name one.
Show answer
First, the targets are loose: two hours and ten minutes can be met by warm standby with continuous replication, so active-active's near-zero RTO is not needed. Second, a single contended inventory count is hard to update safely from several regions, since concurrent decrements can oversell stock and last-writer-wins would silently drop updates. Warm standby, with one writer region, avoids both problems at lower cost and complexity.
Exercise
Using the provisioned_capacity function, how much capacity must you provision for 600 units of peak load across 3 regions if you must survive the loss of one region? What is the overhead compared with a single region sized for 600?
Show answer
Surviving regions: 2, so each region needs 600 / 2 = 300 units. Total is 300 * 3 = 900 units, which is 50 percent more than the 600 a single region would need.