SAP-C02
Deep Dive
The SAP-C02 evaluates correct database selection for each workload, as well as the advanced features of Aurora, DynamoDB and ElastiCache for designing highly available, high-performance systems.
Contents
| Workload | Recommended service | Why |
|---|---|---|
| Relational OLTP (web apps) | RDS MySQL/PostgreSQL or Aurora | ACID transactions, complex relationships, standard SQL |
| High-performance OLTP with global HA | Aurora Global Database | < 1s replication between regions, fast failover |
| Key-value / documents at massive scale | DynamoDB | ms latency, unlimited scale, serverless |
| Graphs (relationships between entities) | Amazon Neptune | Graph traversal with Gremlin or SPARQL |
| Analytical (OLAP) | Redshift | Columnar, complex joins, petabyte scale |
| Query result caching | ElastiCache (Redis/Memcached) | Sub-ms latency, reduces load on the primary DB |
| Time series (metrics, IoT) | Amazon Timestream for InfluxDB | Optimized for time-series, temporal queries |
| Immutable, verifiable ledger | Aurora PostgreSQL + auditing (QLDB was retired) | Change history with audit tables and S3 Object Lock |
| MongoDB-compatible documents | Amazon DocumentDB | Compatible with MongoDB drivers, AWS-managed |
| Distributed global transactional SQL | Amazon Aurora Serverless v2 | Auto-scaling, multi-region via Global DB |
Aurora is AWS's proprietary database engine, compatible with MySQL and PostgreSQL. 5× faster than MySQL and 3× faster than standard PostgreSQL. Storage auto-scales up to 128 TB.
Aurora Global Database
Aurora Serverless v2
Aurora Read Replicas vs Multi-AZ
Read Replicas (up to 15)
Multi-AZ (Aurora native)
Indexes
GSI (Global Secondary Index)
LSI (Local Secondary Index)
Advanced features
DynamoDB Streams
Captures changes (INSERT, MODIFY, DELETE) in real time as an ordered stream. Trigger Lambda for event-driven patterns. 24h retention.
Global Tables
Multi-region active-active replication. Every region can read and write. Conflict resolution: "last write wins" by timestamp.
DAX
DynamoDB Accelerator: in-memory cache fully compatible with the DynamoDB API. Reduces latency from ms to microseconds. No app code changes needed.
Transactions
TransactWriteItems / TransactGetItems: ACID operations across multiple items/tables atomically. 2× the RCU/WCU cost.
TTL
Time-to-Live: automatically deletes expired items with no WCU cost. For sessions, cache, temporary data.
| Feature | Redis | Memcached |
|---|---|---|
| Data structures | Strings, Lists, Sets, Sorted Sets, Hashes, Bitmaps, HyperLogLog | Simple strings only |
| Persistence | Yes (RDB + AOF) — data survives restarts | No — memory-only data |
| Replication | Primary + up to 5 read replicas | No — no replication |
| Multi-AZ / Failover | Yes — automatic failover to a replica | No |
| Pub/Sub | Yes — messaging channels | No |
| Lua scripting | Yes — complex atomic operations | No |
| Horizontal sharding | Redis Cluster: automatic, up to 500 shards | Yes — multiple nodes in a pool |
| Best for | Leaderboards, sessions, pub/sub, complex caching | Simple object cache, simple multithreaded workloads |
Exam rule: when you need persistence or replication → Redis
If the scenario mentions "session state that must survive restarts", "leaderboard", "pub/sub", "automatic failover", or "complex structured data" → Redis. If it says "simple stateless object cache" or "multithreaded" → Memcached.
Amazon Neptune
Managed graph database. Supports Property Graph (Gremlin, openCypher) and RDF (SPARQL). For social networks, fraud detection, recommendation engines where relationships between entities matter as much as the data itself.
Amazon QLDB (retired)
It was AWS's ledger database and reached end of support on July 31, 2025; AWS recommends migrating to Aurora PostgreSQL with audit tables. Immutable, cryptographically verifiable transaction log. Complete history of every change. For financial auditing, supply chain, compliance records where you must prove data hasn't been altered.
Amazon Timestream for InfluxDB
Managed time-series database running the InfluxDB engine. Optimized for timestamped data: IoT metrics, application logs, sensor data, with millisecond queries. The serverless variant, Timestream for LiveAnalytics, stopped accepting new customers in June 2025.
Amazon DocumentDB
MongoDB-compatible document database. Fully managed by AWS. For apps already using MongoDB that want a managed service without modifying application code.
Read Replica Offloading
Directs read queries (reporting, analytics) to Read Replicas to reduce load on the primary instance. Up to 15 replicas in Aurora; up to 5 in RDS.
Caching Strategy (Cache-Aside)
The app first queries ElastiCache. On a cache miss, it queries the DB and stores the result in cache. Reduces latency and DB load.
Write-Through Cache
Every DB write also updates the cache at the same time. Stronger consistency but slower than cache-aside.
Cross-Region Replication
Aurora Global DB or DynamoDB Global Tables for cross-region DR. RTO < 1 minute for Aurora Global.
Blue/Green Deployments (RDS)
RDS Blue/Green: creates an identical (green) environment with schema changes, synchronizes it, and allows a switchover with no downtime.
Trap: "DynamoDB Global Tables uses active-passive replication"
Reality: FALSE. Global Tables is active-active: every region accepts reads AND writes. In a simultaneous write conflict, the latest timestamp wins (last writer wins).
Trap: "Aurora Multi-AZ is the same as RDS Multi-AZ"
Reality: They're different. RDS Multi-AZ has a standby instance that doesn't serve traffic. Aurora replicates storage across 6 copies in 3 AZs and has up to 15 read replicas that DO serve traffic.
Trap: "ElastiCache Redis and DAX are interchangeable"
Reality: No. DAX is a cache specifically for DynamoDB with the same API. ElastiCache Redis is a general-purpose cache that requires caching logic in the app code.
Did you get this topic?
Test what you just learned
A global e-commerce application has its primary database in us-east-1. Users in Asia and Europe report high read latency. The company needs low read latency in every region and write capacity in the main region. What is the most appropriate solution?
Put what you learned to the test with original SAP-C02 exam questions.
Start SAP-C02 mock examUnlimited mock exams with the Pro plan
Log in to track your progress.