Task Statement 4.3: Design cost-optimized database solutions.
📘AWS Certified Solutions Architect – (SAA-C03)
1. What is Database Replication?
Database replication means:
- One primary (master) database handles write operations (INSERT, UPDATE, DELETE)
- One or more replica (read replica) databases receive copies of the data
- Replicas are usually used for read operations (SELECT queries)
2. Key Types of Replication
2.1 Read Replicas (Most Important for Exam)
A read replica is a copy of the primary database that is used only for reading data.
How it works:
- Primary database processes write operations
- Changes are copied to replicas (usually asynchronously)
- Applications send read queries to replicas
Benefits:
- Improves read performance
- Reduces load on the primary database
- Allows scaling reads horizontally
- Can be placed in different Regions for global access
AWS Services:
- Amazon RDS Read Replicas
- Amazon Aurora Replicas
2.2 Multi-AZ Replication (High Availability)
Multi-AZ replication is different from read replicas.
How it works:
- Primary database is automatically replicated to a standby instance in another Availability Zone
- Replication is synchronous
- Standby is not used for reads
Purpose:
- High availability (HA)
- Automatic failover during failure
Key Point:
- Not used for scaling reads (very important for exam)
2.3 Cross-Region Replication
- Replication across AWS Regions
- Used for:
- Disaster recovery
- Global applications
Important:
- Usually asynchronous
- Helps reduce latency for global users
3. Synchronous vs Asynchronous Replication
Asynchronous Replication
- Data is copied after the write is completed
- Faster performance
- Risk of slight data loss during failure
Used by:
- Read replicas
Synchronous Replication
- Data is written to both primary and replica at the same time
- No data loss
- Slightly higher latency
Used by:
- Multi-AZ deployments
4. How Replication Helps with Cost Optimization
Replication is not just about performance—it also helps control costs.
4.1 Offloading Read Traffic
- Instead of scaling up a large, expensive primary database
- Use multiple smaller read replicas
- This reduces cost while maintaining performance
4.2 Right-Sizing Instances
- Primary handles writes only → can be smaller
- Replicas handle reads → distributed workload
4.3 Global Read Optimization
- Place replicas closer to users
- Reduces latency without over-provisioning a single large instance
4.4 Avoid Over-Provisioning
- Without replication, you may increase instance size unnecessarily
- Replicas allow scaling only where needed (reads)
5. AWS Services Supporting Replication
5.1 Amazon RDS
- Supports read replicas
- Supports Multi-AZ
- Supports cross-region replication
5.2 Amazon Aurora
- Supports up to 15 replicas
- Faster replication (low lag)
- Replicas can serve read traffic
- Automatic failover to replicas
5.3 Amazon DynamoDB
- Uses different model (NoSQL)
- Supports Global Tables for multi-region replication
6. Failover and Promotion
Read Replica Promotion
- A read replica can be promoted to a standalone database
- Used during:
- Disaster recovery
- Migration
- Failover scenarios
Important:
- After promotion, replication stops
7. Replication Lag
Replication lag = delay between primary and replica
Causes:
- High write activity
- Network latency
- Large transactions
Impact:
- Replica may not have the latest data
Exam Tip:
- Read replicas are eventually consistent, not strongly consistent
8. When to Use Read Replicas
Use read replicas when:
- Application has heavy read traffic
- Need to scale horizontally
- Reporting queries are slow
- Want to isolate analytics workloads from production database
9. When NOT to Use Read Replicas
Do NOT use read replicas when:
- You need strong consistency
- You need automatic failover (use Multi-AZ instead)
- Your workload is mostly write-heavy
10. Comparison: Read Replicas vs Multi-AZ
| Feature | Read Replicas | Multi-AZ |
|---|---|---|
| Purpose | Scaling reads | High availability |
| Replication type | Asynchronous | Synchronous |
| Read traffic | Yes | No |
| Failover | Manual | Automatic |
| Data consistency | Eventual | Strong |
11. Exam Tips (Very Important)
- Read replicas = performance scaling (reads)
- Multi-AZ = high availability
- Read replicas use asynchronous replication
- Multi-AZ uses synchronous replication
- Read replicas can be promoted
- Replicas may have replication lag
- Use replicas to reduce cost instead of scaling up
12. Summary
Database replication is a key concept for designing scalable and cost-efficient systems:
- Primary database handles writes
- Read replicas handle read queries
- Multi-AZ ensures high availability
- Cross-region replication supports disaster recovery
For the SAA-C03 exam, always remember:
- Use read replicas for scaling reads and cost optimization
- Use Multi-AZ for fault tolerance
- Understand sync vs async replication
- Be aware of replication lag and consistency trade-offs
