Lesson 2 of 3 Database Services

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.

ServiceTypeUse for
Amazon DynamoDBServerless NoSQL key-value and documentSingle-digit millisecond performance at any scale for web, mobile, gaming and IoT; global tables replicate across Regions
Amazon ElastiCacheIn-memory cache (Valkey, Redis OSS, Memcached)Microsecond access to frequent data, reducing database load
Amazon RedshiftData warehouseAnalytics and reporting over large structured data
Amazon DocumentDBDocument (MongoDB-compatible)JSON document workloads
Amazon NeptuneGraphHighly connected data: social networks, fraud detection, recommendations
Match the pairs

Purpose-built databases

Exam skills 3.4.2 · 3.4.3 · 3.4.4

Match each workload with the purpose-built database that suits it.

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

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.

NeedChoose
Structured data with relationships and SQLRDS or Aurora
Massive scale with simple key lookupsDynamoDB
Faster readsElastiCache
Analytics across large data setsRedshift
Worked example

One app, several databases

A mobile game uses different databases for different jobs:

DataDatabaseWhy
Player profiles and game state for millions of playersAmazon DynamoDBFast key lookups at any scale, serverless
Top-100 leaderboard read thousands of times a secondAmazon ElastiCacheIn-memory speed; takes load off DynamoDB
Purchases and refunds with strict accountingAmazon AuroraRelational tables and transactions
"Friends of friends" suggestionsAmazon NeptuneGraph relationships
Monthly analysis of player behaviourAmazon RedshiftData 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.

Check yourself

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.