Task Statement 4.3: Design cost-optimized database solutions.
📘AWS Certified Solutions Architect – (SAA-C03)
1. Core Idea of This Topic (Exam Focus)
In AWS, cost-optimized database design means:
- Selecting the right database type
- Avoiding over-provisioning (paying for unused capacity)
- Matching the database to the application workload pattern
- Using managed and serverless options when possible
- Minimizing operational overhead and scaling costs
The exam frequently tests:
- When to use Amazon RDS
- When to use Amazon DynamoDB
- When to use serverless databases
- Cost vs performance trade-offs
2. AWS Database Categories (Very Important for Exam)
AWS databases are mainly divided into:
2.1 Relational Databases (SQL-based)
Examples:
- Amazon RDS (MySQL, PostgreSQL, MariaDB, Oracle, SQL Server)
- Amazon Aurora
2.2 NoSQL Databases
Examples:
- Amazon DynamoDB (key-value, document database)
2.3 Serverless / Specialized Databases
Examples:
- Aurora Serverless v2
- DynamoDB on-demand mode
- Amazon Neptune, Amazon Timestream, etc. (less common in SAA-C03)
3. Amazon RDS (Relational Database Service)
3.1 What it is
Amazon RDS is a managed relational database service.
It supports:
- Structured data (tables, rows, columns)
- SQL queries
- Strong relationships between data
3.2 Cost Model
RDS cost depends on:
- Instance type (fixed compute capacity)
- Storage (allocated storage)
- I/O operations (in some engines)
- Multi-AZ replication (adds cost)
👉 Important exam idea:
RDS is usually more expensive when traffic is unpredictable because you must pre-provision capacity.
3.3 When to Use RDS (Exam Use Cases)
Use RDS when:
- You need complex SQL queries (JOINs, transactions)
- You need ACID compliance
- Data structure is well-defined and stable
- Applications require relational integrity
Typical AWS scenarios:
- Enterprise applications with structured data
- Inventory systems with relationships (orders, customers, products)
- Legacy applications migrated from on-prem databases
3.4 Cost Optimization Tips for RDS
- Use Reserved Instances for steady workloads
- Use storage autoscaling
- Use read replicas to reduce primary load
- Use Aurora instead of standard RDS for better performance/cost ratio
- Stop non-production databases when not needed
4. Amazon Aurora (Often Confused with RDS)
4.1 What it is
Amazon Aurora is a high-performance relational database compatible with MySQL and PostgreSQL.
4.2 Why it is cost-optimized
Aurora:
- Automatically scales storage up to 128 TB
- Has better performance per cost than standard RDS
- Shares storage across replicas (lower overhead)
4.3 When to use Aurora
Use Aurora when:
- You need high performance relational database
- You expect high read traffic
- You want lower cost per transaction compared to RDS
4.4 Serverless Option: Aurora Serverless v2
This is very important for the exam.
Key idea:
- Automatically scales compute capacity up and down
- You pay only for actual usage
Use cases:
- Variable workloads
- Development/test environments
- Applications with unpredictable traffic
5. Amazon DynamoDB (NoSQL)
5.1 What it is
DynamoDB is a fully managed NoSQL database that supports:
- Key-value data
- Document data
It is designed for:
- High scalability
- Low latency (single-digit milliseconds)
5.2 Cost Model
DynamoDB cost depends on:
- Read and write capacity
- OR On-demand mode (pay per request)
- Storage used
👉 Key exam idea:
DynamoDB is usually more cost-effective for:
- Unpredictable workloads
- Massive scale applications
5.3 Capacity Modes (VERY IMPORTANT)
1. Provisioned Capacity Mode
- You define read/write capacity units
- Cheaper if workload is predictable
2. On-Demand Mode (Serverless DynamoDB)
- No capacity planning required
- Pay per request
- More expensive per request but cheaper for unpredictable traffic
5.4 When to Use DynamoDB (Exam Use Cases)
Use DynamoDB when:
- You need very high scalability
- You need low latency at scale
- Data structure is simple (key-value or document)
- You do NOT need complex joins
Typical AWS scenarios:
- Session storage for web applications
- IoT data ingestion
- Gaming leaderboards
- Real-time application state tracking
- High-speed API backends
5.5 Cost Optimization Tips for DynamoDB
- Use On-Demand mode for unpredictable traffic
- Use Provisioned + Auto Scaling for stable workloads
- Use DAX (DynamoDB Accelerator) for read-heavy workloads
- Use TTL (Time to Live) to delete old data automatically
- Use partition key design to avoid hot partitions
6. DynamoDB vs RDS (VERY IMPORTANT EXAM COMPARISON)
| Feature | Amazon RDS | Amazon DynamoDB |
|---|---|---|
| Data model | Relational (SQL) | NoSQL (Key-value, document) |
| Scaling | Vertical + read replicas | Horizontal auto scaling |
| Performance | Good | Extremely fast (single-digit ms) |
| Schema | Fixed | Flexible |
| Joins | Yes | No |
| Cost efficiency | Best for steady workloads | Best for large-scale / variable workloads |
| Management | More tuning required | Fully serverless (minimal management) |
7. Serverless Database Concept (Key Exam Topic)
7.1 What “serverless database” means
- No server provisioning
- No manual scaling
- Pay only for usage
7.2 AWS Serverless Database Options
1. DynamoDB On-Demand
- Best for unpredictable workloads
- No capacity planning
2. Aurora Serverless v2
- Best for relational workloads with variable usage
- Auto scales compute
7.3 When Serverless is Cost-Effective
Use serverless when:
- Traffic is spiky or unpredictable
- Workloads are development/test
- Applications are event-driven (Lambda-based systems)
8. Choosing the Right Database (Exam Decision Logic)
Use this decision flow:
Step 1: Do you need SQL features?
- YES → Use RDS or Aurora
- NO → Go to Step 2
Step 2: Do you need massive scale + low latency?
- YES → Use DynamoDB
- NO → Consider RDS or Aurora
Step 3: Is traffic unpredictable?
- YES → Use Serverless (DynamoDB On-Demand or Aurora Serverless)
- NO → Use Provisioned RDS or DynamoDB (Provisioned mode)
9. Common Exam Scenarios
Scenario 1
Application needs complex joins and financial transactions.
👉 Answer: Amazon RDS (or Aurora)
Scenario 2
High-traffic API with unpredictable spikes.
👉 Answer: DynamoDB On-Demand
Scenario 3
Relational database with fluctuating traffic.
👉 Answer: Aurora Serverless v2
Scenario 4
Session storage for millions of users.
👉 Answer: DynamoDB
Scenario 5
Stable enterprise application with predictable load.
👉 Answer: RDS with Reserved Instances
10. Key Exam Takeaways (Must Remember)
- RDS = SQL + structured + steady workload
- DynamoDB = NoSQL + massive scale + low latency
- Aurora = high-performance relational + better scaling
- Serverless = pay per usage + best for unpredictable traffic
- Cost optimization depends mainly on:
- workload predictability
- scaling pattern
- query complexity
