Selecting Purpose-Built Databases
This lesson explains how to select a purpose-built database for each workload's access patterns rather than forcing everything into one relational database.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the database options and their data models.
- Select a database from access patterns.
- Describe how zero-ETL integrations and streams move data between stores.
Database options
Choosing a database starts from the data model and access pattern. Amazon Aurora is the relational choice for MySQL and PostgreSQL. Serverless v2 suits variable load, Global Database covers multiple Regions, and I/O-Optimized storage suits I/O-heavy workloads. Limitless Database scales PostgreSQL writes horizontally, and Aurora DSQL provides distributed, active-active SQL. Amazon RDS covers the other relational engines. DynamoDB serves key-value and document access at any scale with single-digit millisecond latency, and ElastiCache provides in-memory speed.
The specialised databases each fit one model. DocumentDB stores MongoDB-compatible documents. Neptune stores graphs, for queries about relationships such as fraud rings, recommendations and knowledge graphs. OpenSearch Service handles search and log analytics, Timestream time series (Timestream for InfluxDB for new workloads, as LiveAnalytics is closed to new customers), Keyspaces Cassandra-compatible wide-column data, and Redshift the data warehouse. The following table summarises the options.
| Database | Best for |
|---|---|
| Amazon Aurora | MySQL/PostgreSQL: Serverless v2 for variable load, Global Database, I/O-Optimized storage, Limitless Database for horizontal PostgreSQL writes, Aurora DSQL for distributed active-active SQL |
| Amazon RDS | Other relational engines |
| DynamoDB | Key-value and document at any scale, single-digit ms latency |
| ElastiCache | In-memory |
| DocumentDB | MongoDB-compatible documents |
| Neptune | Graphs: relationships, fraud rings, recommendations, knowledge graphs |
| OpenSearch Service | Search and log analytics |
| Timestream | Time series |
| Keyspaces | Cassandra-compatible wide-column |
| Redshift | Data warehouse |
How to select
Selection starts from how the data is used rather than from the data itself. The access patterns and queries come first: lookups by key point to DynamoDB, ad hoc joins to a relational database, traversals of relationships to Neptune, and full-text search to OpenSearch. The data model and its relationships, the consistency and transaction requirements, and the latency target then narrow the choice.
Scale matters next: the expected volume of reads, writes and storage, and whether the data must be available in several Regions. The operational model, serverless or provisioned, and cost complete the comparison. Because assumptions about access patterns are often wrong, the candidate store is prototyped with real queries and realistic volumes before the design is committed.
Moving data between stores
Using several purpose-built stores means data often needs to reach more than one of them. Zero-ETL integrations replicate data from Aurora, RDS and DynamoDB into Amazon Redshift, and from DynamoDB into OpenSearch Service, continuously and without pipelines to build or maintain, so analytics and search run on near-current operational data. DynamoDB Streams and event-driven patterns propagate changes to other stores, and AWS DMS migrates or continuously replicates data between database engines when a workload moves from one store to another.
Decomposing one database into purpose-built stores
A marketplace runs everything in one large relational database, and it struggles with very different workloads. The architect maps each access pattern to a store:
Workload Access pattern Store
------------------------------- --------------------------------------- ---------------------------------
Orders and payments ACID transactions, joins Aurora PostgreSQL
Shopping carts and sessions Key lookups, huge scale, spiky DynamoDB (on-demand), TTL on carts
Product search Full-text, facets, relevance OpenSearch Service (zero-ETL from
DynamoDB for product updates)
"Customers also bought" Multi-hop relationships Neptune
Seller dashboards Aggregations over months of orders Redshift (zero-ETL from Aurora)
Leaderboard of top sellers Sorted sets, microsecond reads ElastiCache (Valkey)The relational database is left doing what it does best. Zero-ETL integrations keep the analytical and search copies up to date without custom pipelines, which keeps operational overhead low, a phrase that usually decides between otherwise valid answers.
Which databases suit millisecond lookups of user sessions at any scale?
Show answer
DynamoDB, or ElastiCache when the data fits in memory. A relational database adds overhead for simple key-value access.
Exam Tips
Remember for the exam
- Relationship-heavy queries, such as friends of friends or fraud rings, point to Neptune.
- Analytics on operational data without ETL points to zero-ETL integration with Redshift.
- To scale PostgreSQL writes horizontally, use Aurora Limitless Database.
- Key-value data at massive scale with predictable low latency points to DynamoDB.
- A managed MongoDB-compatible database is DocumentDB.
- Time-series IoT data points to Timestream.