Lesson 2 of 2 Amazon ElastiCache and Purpose-Built Databases

Choosing Purpose-Built Databases by Keyword and Access Pattern

This lesson explains how AWS offers a database for each data model, and how exam questions often contain a keyword that points directly to one of them.

Learning outcomes

After completing this lesson, you will be able to:

  • Map keywords to purpose-built databases.
  • Choose one database per access pattern.

Database by keyword

Exam questions about purpose-built databases usually contain keywords that identify the appropriate service. The following table maps common keywords to their databases.

KeywordDatabaseNotes
MongoDB, JSON documentsAmazon DocumentDBAurora-like storage
Graph, relationships, fraud rings, recommendationsAmazon NeptuneGremlin, openCypher, SPARQL
Cassandra, CQL, wide-columnAmazon KeyspacesServerless
Time series, IoTAmazon TimestreamTimestream for InfluxDB (LiveAnalytics is closed to new customers)
Data warehouse, analyticsAmazon RedshiftColumnar
Full-text search, log analytics, vectorsAmazon OpenSearch Service—
Ledger, immutable historyAurora PostgreSQL or DynamoDB designsQLDB has reached end of support

The following diagram shows the databases from the table with their keywords.

Purpose-built databases and the keywords that point to each: Amazon DocumentDB for MongoDB and JSON documents, Neptune for graphs and relationships, Keyspaces for Cassandra and CQL, Timestream for time series and IoT, Redshift for data warehousing, and OpenSearch Service for full-text search, log analytics and vectors.
Relational and key-value workloads, covered in earlier modules, use Aurora or RDS and DynamoDB.
Match the pairs

Database by keyword

Exam skills 3.3.4 · 2.1.7

Match each keyword with the purpose-built database it points to.

Log in to try this activity Interactive activities are free with an account.

One database per access pattern

Forcing every workload into one relational database causes performance and scaling problems, because each kind of data is best served by a store designed for its access pattern. Microservice architectures therefore often use a database per service, chosen for that service's needs: DynamoDB for shopping carts that need fast key lookups at any scale, Aurora for orders that need transactions and joins, and Neptune for recommendations that follow relationships between customers and products.

Moving to purpose-built databases is supported by migration tools, for example AWS DMS can migrate MongoDB to Amazon DocumentDB, and many of these engines are serverless or scale automatically, which reduces the operational cost of running several of them.

Sort into groups

Which database for each service?

Exam skills 2.1.7 · 3.3.4

Choose a database for each microservice by its access pattern.

Log in to try this activity Interactive activities are free with an account.
Worked example

One database per access pattern

A single application may use several purpose-built databases, each suited to one type of data. The following table identifies the database chosen for each.

DataDatabase
Orders and payments with transactionsAmazon Aurora
User sessions and shopping carts at massive scaleAmazon DynamoDB
Product search with typing-error toleranceAmazon OpenSearch Service
"Customers who bought this also bought" relationshipsAmazon Neptune
Sensor readings every second from 10,000 devicesAmazon Timestream
Existing MongoDB applicationAmazon DocumentDB
Business reporting across years of dataAmazon Redshift

Exam questions usually include one keyword (transactions, key-value, search, graph, time series, MongoDB, data warehouse) that points to the purpose-built database.

Check yourself

Which database suits relationships between friends, products and purchases for recommendations?

Show answer

Amazon Neptune, a graph database designed to query highly connected data.

Exam Tips

Remember for the exam

  • For MongoDB compatibility use DocumentDB; for Cassandra compatibility use Keyspaces.
  • For queries over relationships, such as friends of friends or fraud rings, use Neptune.
  • For IoT sensor time series, use Timestream.
  • For full-text search, use OpenSearch Service.
  • Each microservice should own its data store, chosen for its access pattern.