Choosing Purpose-Built Databases Such as DynamoDB and ElastiCache
This lesson explains how AWS offers purpose-built databases, each designed for particular data models and access patterns, instead of one database for everything.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the purpose-built databases AWS offers, such as Amazon DynamoDB and Amazon ElastiCache.
- Choose a database from the shape of the data and its access pattern.
Purpose-built databases
AWS offers purpose-built databases, each designed for one kind of data and access pattern, instead of using one database for everything. Amazon DynamoDB is a serverless NoSQL database that gives single-digit millisecond performance at any scale, for web, mobile, gaming and IoT applications. Amazon ElastiCache is an in-memory cache that answers frequent requests in microseconds and reduces the load on a database. Amazon Redshift is a data warehouse for analysis and reporting over large amounts of structured data.
Amazon DocumentDB stores JSON documents and is compatible with MongoDB. Amazon Neptune is a graph database for highly connected data, such as social networks, fraud detection and recommendations. The following table summarises the services.
| Service | Type | Use for |
|---|---|---|
| Amazon DynamoDB | Serverless NoSQL key-value and document | Single-digit millisecond performance at any scale for web, mobile, gaming and IoT; global tables replicate across Regions |
| Amazon ElastiCache | In-memory cache (Valkey, Redis OSS, Memcached) | Microsecond access to frequent data, reducing database load |
| Amazon Redshift | Data warehouse | Analytics and reporting over large structured data |
| Amazon DocumentDB | Document (MongoDB-compatible) | JSON document workloads |
| Amazon Neptune | Graph | Highly connected data: social networks, fraud detection, recommendations |
Purpose-built databases
Choosing a database
Choosing a database starts with the shape of the data. Structured data with relationships between tables, queried with SQL, belongs in a relational database: RDS or Aurora. Very large scale with simple lookups by key belongs in DynamoDB. When an existing database is too slow for frequent reads, ElastiCache answers them from memory. Analysis across large data sets belongs in the Redshift data warehouse. The following table summarises the choice.
| Need | Choose |
|---|---|
| Structured data with relationships and SQL | RDS or Aurora |
| Massive scale with simple key lookups | DynamoDB |
| Faster reads | ElastiCache |
| Analytics across large data sets | Redshift |
One app, several databases
A mobile game uses different databases for different jobs:
| Data | Database | Why |
|---|---|---|
| Player profiles and game state for millions of players | Amazon DynamoDB | Fast key lookups at any scale, serverless |
| Top-100 leaderboard read thousands of times a second | Amazon ElastiCache | In-memory speed; takes load off DynamoDB |
| Purchases and refunds with strict accounting | Amazon Aurora | Relational tables and transactions |
| "Friends of friends" suggestions | Amazon Neptune | Graph relationships |
| Monthly analysis of player behaviour | Amazon Redshift | Data warehouse for analytics |
Using one database for everything would make some jobs slow or expensive. AWS's approach is purpose-built databases, each matched to how the data is used.
Which serverless database stores key-value and document data with millisecond performance?
Show answer
Amazon DynamoDB.
Exam Tips
Remember for the exam
- Serverless NoSQL at any scale with millisecond latency is DynamoDB.
- A caching layer to speed up applications is ElastiCache.
- A data warehouse for analytics is Redshift.
- Graph relationships point to Neptune.
- A MongoDB-compatible database is DocumentDB.