Choosing the data and edge services, and what keeps them alive
This chapter covered a lot of services. In a design review, an incident or an exam question they turn into a handful of decisions. This lesson puts the decisions side by side, lists what each one costs while idle, and cleans up what the chapter built.
Need to know: pick a data store by access pattern and consistency before by product; pick a copy by the failure it must survive; pick an edge or network service by what has to reach what; and never call something resilient before a restore or a failover test has shown it.
Databases: which one
| need | choose | why not the others |
|---|---|---|
| relational data, joins, transactions, an existing PostgreSQL app | RDS for PostgreSQL (Multi-AZ) | DynamoDB has no joins; self-managed EC2 means patching and failover are yours |
| the same, with many readers, fast failover, storage that grows by itself | Aurora PostgreSQL | costs more than RDS; PostgreSQL-compatible rather than PostgreSQL itself |
| key-value / document at any scale, single-digit ms, no servers | DynamoDB (on-demand to start) | needs the access patterns known up front; no ad-hoc joins |
| microsecond reads in front of a database, sessions, rate limits | ElastiCache (Valkey) / DAX for DynamoDB | a cache is not a system of record |
| move a database into AWS or between engines | DMS (+ the Schema Conversion Tool for engine changes) | a dump and restore means downtime |
Copies: by the failure they cover
| failure | covered by |
|---|---|
| a host or an AZ | Multi-AZ (RDS), Aurora readers, Multi-AZ caches, EFS / S3 (regional by design) |
| a bad write or a dropped table | point-in-time restore (RDS, DynamoDB), S3 versioning, AWS Backup continuous backup |
| a Region | cross-Region replicas, snapshot / recovery point copies, S3 CRR, DynamoDB global tables, Aurora Global Database |
| a compromised account or ransomware | copies in another account, Object Lock / Vault Lock in compliance mode |
| "we do not know if it works" | restore tests, failover tests, game days |
Which DR strategy to run on top (backup and restore, pilot light, warm standby, multi-site) is a cost-versus-RTO decision: the architecture chapter after this one works through it.
The edge and the network: what has to reach what
| need | use |
|---|---|
| send users to a healthy endpoint, a closer Region, a share of traffic | Route 53 routing policies + health checks |
| cache static and dynamic content close to users, TLS at the edge, hide the origin | CloudFront (+ OAC for S3) |
| filter HTTP attacks and abusive clients | WAF on CloudFront / ALB / API Gateway (+ Shield Advanced) |
| static anycast IPs, fast TCP/UDP failover across Regions | Global Accelerator |
| two VPCs, cheaply | VPC peering |
| many VPCs, VPNs, Direct Connect, one hub | Transit Gateway |
| one service to many VPCs / accounts, overlapping CIDRs | PrivateLink |
| the data centre | Site-to-Site VPN (quick) / Direct Connect (dedicated), ideally both |
What it costs while nobody uses it
Some of these services bill by the hour whether traffic flows or not: RDS instances (twice for Multi-AZ) and their storage, RDS Proxy, ElastiCache nodes, NAT gateways, Transit Gateway attachments, VPN connections, Direct Connect ports, interface endpoints, and Shield Advanced. Others bill by use: DynamoDB on-demand, S3, CloudFront, Lambda. Snapshots and recovery points bill for their storage until they expire. Tag everything (team, env, service, and the backup tag the plan selects), and let lifecycle rules and backup retention delete what nobody needs.
$ aws rds describe-db-instances --query 'DBInstances[].[DBInstanceIdentifier,DBInstanceStatus]' --output text
$ aws dynamodb list-tables --query 'TableNames' --output text
$ aws ec2 describe-transit-gateways --query 'TransitGateways[?State!=`deleted`].TransitGatewayId' --output text
$ aws cloudfront list-distributions --query 'DistributionList.Items[].Id' --output text
None
Once every lab of this chapter is done, opening this lesson removes what the chapter built (the lessons' and labs' databases, tables, caches, file systems, distributions, gateways and VPN), so the lab account stays small. The listings above then come back empty; CloudFront prints None, because an account with no distributions gets a list with no Items at all, and a --query on a missing key gives null.
On the exam (SAA-C03 2.2 and 3.3, SOA-C03 2.2, CLF-C02 3.4): match the failure to the copy (AZ = Multi-AZ, data corruption = point-in-time restore, Region = cross-Region copies or replicas, account = another account plus a lock), the access pattern to the database (relational = RDS / Aurora, key-value at scale = DynamoDB, repeated reads = ElastiCache / DAX), and the reachability need to the network service (peering, Transit Gateway, PrivateLink, VPN, Direct Connect).
In an interview: "How do you know a system is resilient?" - "Because it has failed in a test and come back within its RTO and RPO: a forced RDS failover with the clients watching, a restore from the newest backup into a sandbox with the time recorded, a DNS failover with the primary stopped, and the alarms that told us about each. Until then it is a diagram."
You can now: choose a database, a copy, an edge service and a network service from the requirement, say what each costs while idle, and check that the lab account is clean again.