Sub topic 16
Weighing cost and complexity against availability goals
This chapter assumes you know the multi-AZ building blocks from earlier chapters: subnets per AZ, zonal NAT gateways, cross-zone load balancing, Auto Scaling groups, and RDS Multi-AZ. Here you decide how much of that to buy for a given workload.
Start from the goal, not the pattern
Every resilience feature adds a cost, either money or operational effort. Take the RTO and RPO from the business, then add only what closes the gap. A internal reporting tool that can be down for an hour does not need the design of a payment API.
Where the money goes
| Feature | Cost driver | Cost control |
|---|---|---|
| NAT gateway per AZ | Hourly charge per gateway plus per-GB processing | Use gateway endpoints for S3 and DynamoDB, which have no hourly charge |
| RDS Multi-AZ | You pay for a standby instance and its storage | Use it for production only |
| Spare capacity | Instances idle in surviving AZs | Choose the number of AZs deliberately |
| Cross-AZ traffic | Per-GB charge for data crossing AZs | Keep chatty components in the same AZ where failure isolation allows |
| Cross-zone load balancing | Cross-AZ data charges on Network Load Balancers, none on Application Load Balancers | Enable it only where uneven load is a problem |
Check current regional pricing before you commit. Rates change.
Capacity headroom is the largest hidden cost
Static stability means the surviving AZs can absorb the load without launching anything new. The headroom you need depends on the AZ count.
With 2 AZs, each must carry 100% of peak load, so you run 200% of required capacity. With 3 AZs, each carries 50% of peak after a loss, so you run 150%. Adding a third AZ can lower your compute bill while improving resilience, although it adds a third NAT gateway and more subnets.
Complexity is a cost too
Each added component gives you something more to patch, monitor, and test. A design you never test is a design you cannot trust. Prefer managed features such as Multi-AZ, Aurora, and ALB over self-built failover, and budget time for game days.
Reduce cost without breaking isolation
Here is a safe saving: send S3 traffic through a gateway endpoint so it skips the NAT gateway.
Resources:
S3GatewayEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref Vpc
ServiceName: !Sub com.amazonaws.${AWS::Region}.s3
VpcEndpointType: Gateway
RouteTableIds:
- !Ref PrivateRouteTableA
- !Ref PrivateRouteTableBMatch the environment to the tier
- Development: single AZ, minimal headroom.
- Staging: mirror production topology at a smaller scale so failover tests are meaningful.
- Production: multi-AZ for every tier that is on the request path.
Exercise
A stateless web tier needs 6 instances at peak. Compare total instances required to survive one AZ loss with 2 AZs and with 3 AZs.
Show answer
With 2 AZs, each must hold all 6, so you run 12 instances. With 3 AZs, the two survivors must hold 6, so each needs 3 and the total is 9. Three AZs use fewer instances but add a third NAT gateway and subnet set.