Data Tier Resilience: RDS, Aurora, DynamoDB and Caches
Overview
Stateless compute is easy to make resilient because you can replace it. The data tier is harder: it holds the truth, so you need replication, failover and recovery that protect against instance, AZ, Region and human-error failures. Each AWS data service has its own availability model.
Think of a bank. Multi-AZ is the vault with a live mirror in the next building that takes over instantly; read replicas are branch offices that answer balance queries; point-in-time recovery is the transaction journal that lets you rewind to before a clerk's mistake.
For the exam, distinguish high availability (Multi-AZ, synchronous or storage-level) from scaling reads (replicas) from disaster recovery (cross-Region) from recovery of bad data (PITR, snapshots, backtrack).
Key Concepts
- RDS Multi-AZ instance uses synchronous replication to one standby and fails over in roughly 60-120 seconds; the standby is not readable.
- RDS Multi-AZ DB cluster (two readable standbys) fails over typically under 35 seconds and offers readable replicas.
- Aurora stores six copies across three AZs; failover to a replica usually completes in under 30 seconds, and Aurora Global Database adds cross-Region DR.
- RDS Proxy pools connections and preserves them through failover, cutting failover impact for Lambda and bursty apps.
- Read replicas scale reads asynchronously and can be promoted; they are not a substitute for Multi-AZ.
- DynamoDB is multi-AZ by default; PITR restores to any second in the last 35 days and global tables add multi-Region multi-active writes.
- ElastiCache Multi-AZ with automatic failover and Global Datastore protect caches; remember caches can be rebuilt but cold caches overload databases.
- RDS/Aurora Blue/Green Deployments let you test and switch major changes with minimal downtime.
Detailed Notes
Choosing the right resilience feature
| Goal | RDS (non-Aurora) | Aurora | DynamoDB |
|---|---|---|---|
| Survive instance/AZ failure | Multi-AZ instance or cluster | Replicas in other AZs | Built-in |
| Scale reads | Read replicas (up to 15 for most engines) | Up to 15 Aurora replicas, shared storage | DAX, on-demand capacity |
| Cross-Region DR | Cross-Region read replica, snapshot copy | Global Database (lag typically under 1 s) | Global tables |
| Undo bad writes | PITR (up to 35 days), snapshots | PITR, Backtrack (MySQL), clones | PITR, on-demand backups |
| Zero-downtime major change | Blue/Green Deployments | Blue/Green Deployments | Not needed |
Failover behaviour
- RDS Multi-AZ flips the DNS CNAME of the endpoint to the standby, so clients must re-resolve DNS and use short DNS caching (JVM TTL!). Trigger a test with
aws rds reboot-db-instance --db-instance-identifier db1 --force-failover. - Aurora uses a cluster endpoint (writer), reader endpoint (load balanced replicas) and custom endpoints. Promotion tiers (0-15) decide which replica is promoted first.
- RDS Proxy keeps application connections open and routes them to the new writer, reducing failover time perceived by clients and protecting databases from connection storms.
aws rds failover-db-cluster --db-cluster-identifier orders-cluster
aws rds restore-db-cluster-to-point-in-time \
--source-db-cluster-identifier orders-cluster \
--db-cluster-identifier orders-restore \
--restore-to-time 2025-03-02T09:14:00Z
Restore operations always create a new cluster or instance; you then repoint the application or swap names.
Multi-Region data patterns
| Pattern | Use | Caveat |
|---|---|---|
| Aurora Global Database, managed planned switchover | Regional rotation, DR drills | Unplanned failover needs detach and promote; write forwarding available for secondaries |
| DynamoDB global tables (active-active) | Local writes in every Region | Last-writer-wins; design idempotent writes and avoid hot conflicting items |
| S3 CRR with replication time control | Object DR | Needs versioning; existing objects need Batch Replication |
| ElastiCache Global Datastore | Cross-Region cache reads | Writes only in primary |
| Secrets, parameters, AMIs, ECR | Replicate config and artifacts | Secrets Manager multi-Region secrets, ECR replication |
DynamoDB resilience details
aws dynamodb update-continuous-backups --table-name Orders \
--point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
aws dynamodb update-table --table-name Orders \
--replica-updates '[{"Create":{"RegionName":"eu-west-1"}}]'
PITR and on-demand backups restore to a new table and do not affect performance. Global tables require streams (enabled automatically) and, in the current version, support strongly consistent reads only within the same Region as the write. Deletion protection and IAM conditions guard against accidental table drops.
Operational safeguards
- Enable deletion protection on RDS/Aurora and set final snapshot on delete.
- Use AWS Backup for centralised, cross-account copies, and encrypted snapshots with KMS keys shared or re-encrypted per destination account/Region.
- Monitor ReplicaLag, AuroraGlobalDBReplicationLag, connections and Performance Insights; alarm before applications notice.
- Test failovers regularly; verify application retry logic, DNS caching and connection pool validation.
- Design for graceful degradation: serve cached or read-only data if the writer is unavailable.
Failure-mode checklist for data tiers
| Failure | Mitigation |
|---|---|
| Writer AZ outage | Multi-AZ failover (RDS 60-120 s, Aurora typically under 30 s) |
| Region outage | Aurora Global Database (RPO about 1 s, managed failover), DynamoDB global tables, S3 CRR |
| Accidental delete or corruption | PITR, snapshots, AWS Backup with Vault Lock, S3 versioning |
| Connection storms | RDS Proxy, connection pooling |
| Replica lag | Read from the writer when freshness matters; monitor AuroraReplicaLag |
Remember that replication copies mistakes too, so combine replication (availability) with backups (recoverability).
Real World Example
Scenario: a ticketing platform loses its writer during a flash sale. It runs Aurora with replicas in three AZs behind RDS Proxy. When the writer instance fails, a replica is promoted in under 30 seconds and Proxy re-routes connections, so Lambda-based checkout sees a brief retry instead of an outage.
Months later a faulty migration deletes rows. The team restores the cluster to a time just before the migration using point-in-time recovery, validates it, and cuts over by swapping endpoints. A DynamoDB global table holds sessions in two Regions so users stay logged in during a regional rotation exercise.
Architecture Diagram
Synchronous HA in a Region, replication across Regions, and point-in-time recovery for mistakes.
- 1The application connects through RDS Proxy to the Aurora writer endpoint.
- 2Storage is replicated six ways across three AZs, with replicas ready for promotion.
- 3On writer failure a replica is promoted and Proxy redirects connections.
- 4Aurora Global Database and DynamoDB global tables keep the secondary Region current.
- 5PITR or backups restore a new cluster when data is corrupted.
Best Practices
- ✓Use Multi-AZ or Aurora replicas for every production database, and test failover.
- ✓Put RDS Proxy in front of Lambda and high-connection workloads.
- ✓Enable PITR, deletion protection and cross-account backup copies.
- ✓Keep DNS TTL low and enable connection retry and validation in clients.
- ✓Choose global tables or Aurora Global Database based on write pattern, and design for conflict handling.
Common Interview Questions
Exam Tips
DOP-C02 focus
- "Standby cannot serve reads, automatic failover" = RDS Multi-AZ instance.
- "Undo accidental deletion" = PITR / Backtrack / snapshot, not Multi-AZ or replicas.
- "Multi-Region active-active key-value" = DynamoDB global tables.
- "Lambda exhausting database connections" = RDS Proxy.
Finished this lesson?
0 of 44 lessons done · 0% of the course

