5.2 Storage and Database Deep Dive
Key Takeaways
- S3 Versioning keeps multiple variants of an object to protect against accidental deletion — enable it for critical data.
- S3 Lifecycle Policies automatically transition objects between storage classes or delete them after a specified time period.
- RDS Multi-AZ provides high availability with a synchronous standby replica in a different AZ for automatic failover.
- RDS Read Replicas provide read scaling by creating asynchronous copies that serve read traffic independently.
- DynamoDB Global Tables provide fully managed multi-Region, multi-active database replication.
Storage and Database Deep Dive
Amazon S3 Advanced Features
S3 Versioning
Versioning keeps multiple variants of an object in the same bucket. When enabled:
- Every object has a unique version ID
- Deleting an object adds a delete marker (the object can be recovered)
- You can restore previous versions
- Protects against accidental overwrite and deletion
S3 Lifecycle Policies
Lifecycle policies automate moving objects between storage classes:
Example policy:
- Object stored in S3 Standard (day 0)
- After 30 days, transition to S3 Standard-IA (infrequent access)
- After 90 days, transition to S3 Glacier Flexible Retrieval (archive)
- After 365 days, delete the object
S3 Object Lock
Object Lock prevents objects from being deleted or overwritten for a specified retention period. Used for regulatory compliance (WORM — Write Once Read Many).
S3 Replication
| Type | Description |
|---|---|
| Cross-Region Replication (CRR) | Replicate objects to a bucket in a different Region |
| Same-Region Replication (SRR) | Replicate objects to a bucket in the same Region |
Use cases: Compliance (data in multiple Regions), disaster recovery, lower latency access
S3 Transfer Acceleration
Uses CloudFront edge locations to accelerate uploads to S3. Clients upload to the nearest edge location, and AWS routes data to S3 over its optimized network.
Amazon EBS Advanced Features
EBS Snapshots
- Point-in-time backups of EBS volumes stored in S3
- Incremental — only changed blocks are saved after the first snapshot
- Can be used to create new volumes in the same or different AZ/Region
- EBS Snapshot Archive — move rarely accessed snapshots to a lower-cost tier (75% cheaper)
- Recycle Bin — protect against accidental deletion with configurable retention
EBS Encryption
- Encrypts data at rest, in transit between instance and volume, and all snapshots
- Uses AWS KMS keys
- Minimal impact on latency
- Encryption of an existing unencrypted volume requires creating an encrypted snapshot and restoring from it
Amazon RDS Advanced Features
Multi-AZ Deployments
Multi-AZ provides high availability by maintaining a synchronous standby replica in a different AZ.
| Feature | Detail |
|---|---|
| Purpose | High availability (failover protection) |
| Replication | Synchronous |
| Failover | Automatic (typically 60-120 seconds) |
| Read Traffic | Standby cannot serve reads (it is only for failover) |
| Cost | ~2x the cost of single-AZ |
Read Replicas
Read Replicas create asynchronous copies of your database for read scaling.
| Feature | Detail |
|---|---|
| Purpose | Read scaling (offload read traffic) |
| Replication | Asynchronous |
| Read Traffic | Yes — serves read queries |
| Write Traffic | No — only the primary handles writes |
| Cross-Region | Yes — can create replicas in other Regions |
| Promotion | Can be promoted to a standalone database |
On the Exam: Multi-AZ = high availability (automatic failover). Read Replica = read performance scaling. These are different concepts — know the distinction.
RDS Automated Backups
- Automated backups enabled by default (1-35 day retention)
- Point-in-time recovery to any second within the retention period
- Snapshots — manual backups that persist until you delete them
Amazon DynamoDB Advanced Features
DynamoDB Streams
Captures a time-ordered sequence of item changes in a DynamoDB table. Can trigger Lambda functions for event-driven processing.
DynamoDB Global Tables
Multi-Region, multi-active replication. All replicas can handle read AND write operations, with automatic conflict resolution.
DynamoDB Accelerator (DAX)
In-memory cache for DynamoDB that delivers up to 10x read performance improvement (from milliseconds to microseconds).
DynamoDB On-Demand vs. Provisioned
| Mode | Description | Best For |
|---|---|---|
| On-Demand | Pay per request, no capacity planning | Unpredictable workloads, new tables |
| Provisioned | Define read/write capacity units | Predictable workloads, cost optimization |
AWS Backup
AWS Backup is a fully managed service that centralizes and automates backup across AWS services (EBS, RDS, DynamoDB, EFS, S3, and more).
| Feature | Description |
|---|---|
| Backup Plans | Define backup schedules and retention policies |
| Cross-Region Backup | Copy backups to another Region for disaster recovery |
| Cross-Account Backup | Copy backups to another AWS account |
| Compliance | Enforce backup policies with AWS Organizations |
What is the primary purpose of Amazon RDS Multi-AZ deployment?
A company wants to automatically move S3 objects to cheaper storage classes as they age. Which feature should they use?
What is the difference between RDS Multi-AZ and Read Replicas?
Which DynamoDB feature provides multi-Region, multi-active database replication?
EBS Snapshots are: