Choosing the Right AWS Database: ElastiCache, Redshift, DocumentDB, Neptune, Timestream and Database Migration
One Size Does Not Fit All
AWS offers purpose-built databases. Instead of forcing every kind of data into one database, you choose the one that fits the shape of the data and the questions you ask.
| Data type or need | AWS service |
|---|---|
| Structured data, SQL, transactions | RDS / Aurora |
| Key-value or document with huge scale and low latency | DynamoDB |
| In-memory cache, sessions, leaderboards | ElastiCache / MemoryDB |
| Analytics on large structured data (data warehouse) | Redshift |
| MongoDB-compatible documents | DocumentDB |
| Relationships and graphs (social, fraud) | Neptune |
| Time-series (sensors, metrics) | Timestream |
| Wide-column, Apache Cassandra compatible | Keyspaces |
| Search and log analytics | OpenSearch Service |
Amazon ElastiCache
- Managed in-memory data store. Engines: Redis/Valkey and Memcached. Reads in microseconds
- Use as a cache in front of a database to reduce load and speed up pages, or for sessions, leaderboards, queues and real-time counters
- Redis: persistence, replication, Multi-AZ failover, data structures. Memcached: simple, multi-threaded, no persistence
- MemoryDB is a Redis-compatible durable primary database
Caching Pattern: Cache-Aside
python
import json, redis, boto3
cache = redis.Redis(host="my-cache.xxxx.cache.amazonaws.com", port=6379, ssl=True)
table = boto3.resource("dynamodb").Table("Products")
def get_product(pid):
cached = cache.get(f"product:{pid}")
if cached: # 1. cache hit
return json.loads(cached)
item = table.get_item(Key={"id": pid}).get("Item") # 2. cache miss: read database
if item:
cache.setex(f"product:{pid}", 300, json.dumps(item, default=str)) # 3. store for 5 minutes
return item
- Set a TTL so data does not stay stale forever
- Cache hit = answer from memory. Cache miss = read database and fill cache
- Watch hit ratio and evictions
Amazon Redshift
- A data warehouse for analytics on big structured data (terabytes to petabytes) using SQL
- Columnar storage and parallel processing make large reports fast
- Redshift Serverless removes cluster sizing. Use Redshift Spectrum to query S3
- Not for high-volume small transactions. That is OLTP, use RDS/Aurora/DynamoDB
- OLTP = many small updates (orders). OLAP = few heavy reads (reports)
Other Purpose-Built Databases
| Service | Use | Example |
|---|---|---|
| DocumentDB | JSON documents, MongoDB-compatible | Content catalogs, user profiles |
| Neptune | Graph (nodes and relationships) | Friend recommendations, fraud rings, knowledge graphs |
| Timestream | Time-series with fast ingestion and retention policies | IoT sensor data, application metrics |
| Keyspaces | Managed Apache Cassandra | Large wide-column workloads |
| QLDB (ledger) | Immutable history (being retired, use Aurora with audit design) | Audit trails |
| OpenSearch Service | Full-text search and log analytics | Site search, log exploration |
Database Migration: DMS and SCT
- AWS Database Migration Service (DMS) moves data between databases with minimal downtime by doing a full load and then continuous replication (CDC)
- Same engine (MySQL to Aurora MySQL): simple. Different engine (Oracle to PostgreSQL): first convert the schema with AWS Schema Conversion Tool or DMS Schema Conversion
- Steps: create a replication instance and endpoints, create a task, run full load + CDC, verify, switch the app
Self-Managed on EC2 or Managed Service?
| Run your own database on EC2 | Use a managed AWS database |
|---|---|
| Full control, custom software | AWS handles patching, backups, failover, scaling |
| You manage everything | Lower admin effort, built-in best practices |
| Good for special needs | Recommended for most cases |
Quick Decision Questions
- Is the data relational with joins? → RDS/Aurora
- Is it key-value at massive scale with simple access? → DynamoDB
- Do I need sub-millisecond speed for hot data? → ElastiCache or DAX
- Is it reporting over huge history? → Redshift
- Does it need relationships as the main feature? → Neptune
- Is it time-stamped measurements? → Timestream
Practice
- Match five sample applications (online store, IoT sensors, social network, BI reports, session storage) to a database
- Create a small ElastiCache Redis cluster and test
SETandGET - Load a CSV into Redshift Serverless using
COPYfrom S3 (optional lab) - Explain why a data warehouse is not a good order system
Conclusion
Choose databases by data shape and access pattern: RDS and Aurora for relational, DynamoDB for key-value scale, ElastiCache for in-memory speed, Redshift for analytics, and purpose-built services such as Neptune, DocumentDB and Timestream. Use DMS to migrate with minimal downtime.
Quick Summary: purpose-built idea; ElastiCache; cache-aside; Redshift; others; migration; self-managed vs managed; decision.

