Course outline

16.1

Database Types and How to Choose

The questions to ask, relational vs NoSQL vs warehouse vs search vs graph vs time series, with a decision map.

22 min Reading + animations

Tip: tap or hover any dotted-underlined term to see what it means.

By the end of this lesson you will be able to

  • Ask the questions that decide a database: read or write heavy, throughput and spikes, size and growth, object size, access pattern, durability and source of truth, latency, concurrent users, data model, joins, schema, reporting, search and licence cost.
  • Name the database families (relational OLTP, key-value, in-memory, document, wide-column, graph, time series, ledger, object store, warehouse OLAP, search, SQL over S3) and the AWS service for each.
  • Tell OLTP from OLAP, and explain why a report on the checkout database hurts customers and where it should run instead (read replica, Redshift, Athena).
  • Recall, in one card each, when to pick RDS, Aurora, ElastiCache, MemoryDB, DynamoDB and S3, with their exam keywords and anti-patterns.
  • Use a decision map and a keyword map to answer “which database?” exam questions, and spot the trap answer.
  • Recognise retired or changed services (Quantum Ledger Database, Timestream for new accounts) and new ones (Aurora DSQL, Valkey) and know what the exam still expects.

#Why the choice matters

AWS offers more than fifteen managed databases. That is not a menu where one item is the best; each one is built for a particular shape of data and a particular kind of question. Pick the wrong one and the app works on day one, then slows down, costs too much or loses data as it grows. Pick the right one and most of the hard problems (scaling, failover, backups) are already solved for you.

The notes put it this way: if you know when, why and in which architectural pattern to use each service, you can answer most database questions in the exam. They also say databases and storage make up 15 to 20% of the questions. That figure is unofficial: the SAA-C03 exam has four domains, Secure Architectures (30%), Resilient Architectures (26%), High-Performing Architectures (24%) and Cost-Optimized Architectures (20%), and database questions appear in all four. Either way, they are many.

This lesson is the map of the whole chapter. RDS, Aurora and ElastiCache were taught in chapter 7, DynamoDB in lessons 15.4 and 15.5, S3 and Glacier in chapter 10. Here each gets a short recap card and a link back. The four purpose-built engines, DocumentDB, Neptune, Keyspaces and Timestream, get one line each here and a full lesson next, in 16.2.

#The questions to ask

Before naming a service, answer these. Each one points towards some families and away from others.

QuestionWhy it mattersPoints towards
Read-heavy, write-heavy or balanced?Reads scale with replicas and caches; writes need a store that spreads themRead-heavy: replicas, ElastiCache, DAX. Write-heavy: DynamoDB, Keyspaces, Timestream
Throughput, and does it change or spike during the day?Fixed instances must be sized for the peak; serverless scales with the trafficSpiky: DynamoDB on-demand, Aurora Serverless v2. Steady: provisioned RDS
How much data, for how long, and will it grow?Some stores grow by themselves, others have a provisioned sizeUnbounded growth: DynamoDB, S3, Aurora storage. History for years: S3 + Glacier, Redshift
Average object size?Databases are built for small rows and items; big files belong elsewhereLarge objects: S3. DynamoDB items are at most 400 KB
How is the data accessed?Known key lookups vs ad-hoc questions decide relational vs NoSQLBy key: DynamoDB. Ad-hoc, changing questions: SQL
Durability, and is this the source of truth?A cache may lose data; the system of record must notSource of truth: RDS, Aurora, DynamoDB, MemoryDB, S3. Copies: ElastiCache, OpenSearch
Latency needed?Milliseconds and microseconds need different technologyMicroseconds: ElastiCache, DAX, MemoryDB. Single-digit ms: DynamoDB
How many concurrent users?Connections and concurrency limit instance-based databasesVery many: DynamoDB, or RDS Proxy in front of RDS (lesson 7.4)
Data model?Rows, items, documents, graphs and time series each have a native storeSee the families below
Joins?Only relational databases (and warehouses) join wellJoins: RDS, Aurora, Redshift. No joins: DynamoDB
Strict schema or flexibility?Relational schemas protect data; NoSQL lets items differStrict: SQL. Rapidly evolving schema: DynamoDB, DocumentDB
Reporting?Analytics must not run on the transactional databaseRedshift, Athena (chapter 17)
Search?Free-text search needs a search indexOpenSearch
Licence costs?Oracle and SQL Server licences are expensiveMove to a cloud-native engine such as Aurora; Babelfish for SQL Server apps

Two of these deserve a sentence more.

  • Source of truth. For every piece of data, decide which store holds the real copy. Everything else (a cache, a search index, a warehouse) is a copy that can lag behind or be rebuilt. Most data-loss stories begin with a copy that was treated as the original.
  • Access pattern. A relational database lets you ask questions you have not thought of yet, because SQL can filter, join and group any column. A key-value store is fastest when you know every question in advance and design the key for it. “We do not know yet what we will ask” is a strong vote for SQL.

#Worked example: a ride-sharing app

A Pathao-style ride app in Dhaka answers the questions like this:

DataAnswersStore
Riders, drivers, payments, promo codesJoins (trip with rider, driver and fare), money must be exact, ad-hoc questions from financeAurora PostgreSQL
Live trip state by trip IDWrite-heavy, huge spikes at rush hour, always read by key, single-digit msDynamoDB
Sessions and surge-price lookupsRead many times a second, can be rebuilt, sub-millisecondElastiCache
Driver location pings every few secondsTime-stamped, enormous volume, queried by time windowTimestream or Keyspaces (lesson 16.2)
Profile photos, trip receipts as PDFLarge objectsS3
“Rides per area per hour for last year”Analytics over historyRedshift or Athena over S3
“Find a restaurant” search boxFree text, typosOpenSearch

Using several stores, each for what it does best, is called polyglot persistence. It is normal on AWS, and you will see it again at the end of this lesson.

#Database types

The slides group AWS databases into families. Here they are with the service for each, the shape of data, and what each is good and bad at.

FamilyAWS serviceData modelGreat atPoor atTaught in
Relational (SQL, OLTP)RDS, AuroraTables of rows, fixed schema, SQLJoins, transactions (ACID), ad-hoc queriesMassive write scale, unstructured data7.1–7.4
Key-valueDynamoDBItems found by a partition key (and sort key), JSON-likeAny scale, single-digit ms, serverlessJoins, ad-hoc queries, big items15.4, 15.5
In-memoryElastiCache (cache), MemoryDB (durable database)Keys with values and data structures, in RAMMicrosecond reads, sessions, leaderboardsLarge datasets cheaply; ElastiCache is not a system of record7.5
DocumentDocumentDBJSON documents, MongoDB APIFlexible nested records, MongoDB appsMulti-document joins16.2
Wide-columnKeyspacesPartitions of rows with many columns, Cassandra APIHuge write-heavy workloads, Cassandra appsJoins, ad-hoc queries16.2
GraphNeptuneNodes and edges (relationships)Highly connected data, many-hop queriesSimple bulk lookups, analytics over columns16.2
Time seriesTimestreamMeasurements with a timestampMetrics, IoT readings, time windowsUpdates of old data, joins16.2
LedgerQuantum Ledger Database (retired)Append-only journal with cryptographic proofVerifiable history(end of support 2025)below
Object storeS3, S3 Glacier storage classesObjects (files) in buckets by keyBig objects, unlimited size, 11 nines durability, archivesMany tiny updates, queries inside datachapter 10
Data warehouse (OLAP)RedshiftColumnar tables, SQLBI and reports over terabytes to petabytesMany small transactions17.2
SQL over S3Athena (and EMR for big-data frameworks)Files in S3 queried in placeAd-hoc, serverless, pay per queryLow-latency app queries17.1, 17.4
SearchOpenSearchJSON documents with an inverted indexFree text, fuzzy and partial match, log analyticsBeing the source of truth17.3

The slides call relational databases “great for joins” and NoSQL databases “no joins, no SQL”. That is the exam’s mental model; a few NoSQL services do have SQL-like languages (DynamoDB’s SQL-compatible query language, the Cassandra Query Language on Keyspaces), but none of them join tables the way a relational database does.

#OLTP vs OLAP

These two words come back in every “which database” question.

  • OLTP (online transaction processing) is the day-to-day work of an application: place an order, transfer money, update a profile. Many users, many small transactions, each touching a few rows, each needing to be correct (ACID) and fast. Data is stored row by row, because a transaction reads or writes a whole row. On AWS: RDS and Aurora.
  • OLAP (online analytical processing) is asking big questions about history: total sales by district and month for three years. Few users, few queries, each reading millions or billions of rows but only a few columns. Data is stored column by column, compressed, and the work is spread over many nodes. On AWS: Redshift (and Athena for files in S3).

The classic mistake is to run OLAP on the OLTP database. Watch what happens:

Checkout and the month-end report: OLTP vs OLAP

A Dhaka online shop keeps its orders in Aurora. Watch what a big report does to checkout when it runs on the primary, on a replica, in a Redshift warehouse, or as Athena SQL over files in S3.

Scenario

Many tiny, short transactions that touch a few rows each: what a relational OLTP database is built for.

Shoppers
Aurora writerorders3 ms
Finance analyst
Aurora replica
insert order
Step 1 of 3
1

A shopper places an order. One transaction inserts the order, reduces the stock and records the payment: all or nothing (ACID). Indexes find the few rows it needs, so it takes a few milliseconds.

A read replica is the quick fix: it moves the load off the writer. But a replica stores rows like the writer does, so big reports stay slow, and it is sized for app traffic. For real analytics, copy the data to a warehouse. Aurora, RDS for MySQL and DynamoDB can feed Redshift through zero-ETL integrations with no pipeline to build (lesson 7.3). If the data is already files in S3 and the questions are occasional, Athena queries them in place and charges per data scanned. Redshift is lesson 17.2 and Athena lesson 17.1; the slides note that these belong to the data and analytics section.

#NoSQL is not one thing

“NoSQL” only says what a database is not. The five NoSQL families on AWS are very different from each other:

  • Key-value (DynamoDB): you give a key, you get an item. Fastest and most scalable when every question is “get the thing with this key” or “get the items with this partition key, sorted by this sort key”.
  • In-memory (ElastiCache, MemoryDB): key-value in RAM with rich data structures (sorted sets, hashes, lists, geospatial). Microseconds.
  • Document (DocumentDB): each record is a JSON document that can nest and differ from the others; you can query and index fields inside documents. The answer for MongoDB applications.
  • Wide-column (Keyspaces): rows grouped in partitions, built to take enormous write volumes across many nodes. The answer for Apache Cassandra applications.
  • Graph (Neptune): the relationships are the data. “Friends of friends”, “accounts linked to a fraudster”, “customers who bought this also bought”.

The slides list Neptune twice, under NoSQL and again under graphs; it is one service.

#Search, analytics and the rest, in one line each

  • OpenSearch (successor of Elasticsearch on AWS): a search and log analytics engine. Feed it a copy of your data for free-text search, partial and fuzzy matching, relevance ranking and log dashboards. Never the source of truth. Lesson 17.3.
  • Redshift: the data warehouse for OLAP and BI. Lesson 17.2.
  • Athena: serverless SQL directly on files in S3. Lesson 17.1.
  • EMR: managed Hadoop and Spark clusters for big-data processing; the slides place it with warehouses. Lesson 17.4.

#Ledger: the Quantum Ledger Database is retired

#Newer services and names, 2024 to 2026

#Recap cards: the five services you already know

The notes give each service a short overview. Here they are as cards: what it is, when to pick it, the exam keywords, and when not to pick it. Follow the link for the full lesson.

#Amazon RDS

What: a managed relational database service. Traditional SQL (tables, rows, columns) in the cloud; AWS handles provisioning, OS patching and backups. You choose an instance size and an EBS storage type and size (storage auto scaling can grow it).

Engines: PostgreSQL, MySQL, MariaDB, Oracle, Microsoft SQL Server and IBM Db2. Aurora is a separate, AWS-built engine with its own card below. RDS Custom gives access to the underlying OS and database for Oracle and SQL Server.

Key features:

  • Multi-AZ: a synchronous standby copy in another Availability Zone with automatic failover when the primary fails. It is for availability, not performance: the standby of a Multi-AZ instance serves no reads. It protects against an AZ failure, not a Region failure (lesson 7.1).
  • Read replicas: asynchronous copies that serve read queries only, up to 15 per source on most engines (the notes say 5, an old limit; Db2 allows 3). A replica can be in another Region, which also helps disaster recovery.
  • Backups: automated backups with point-in-time recovery for 1 to 35 days, plus manual snapshots kept as long as you like (lesson 7.2).
  • Security: IAM database authentication, security groups, KMS encryption at rest, TLS in transit, Secrets Manager integration (lesson 7.4). Maintenance is managed and scheduled, and can mean brief downtime.

Pick it when: relational data, SQL and transactions, especially on Oracle, SQL Server or Db2, or a small steady MySQL/PostgreSQL workload where cost matters most.

Exam keywords: “high availability / disaster recovery” → Multi-AZ; “read performance scaling” → read replica; “root access to the OS or database internals” → RDS Custom (Oracle, SQL Server).

Not for: unlimited write scale, key lookups at millions per second, big files, free-text search, heavy analytics on the primary.

#Amazon Aurora

What: AWS’s own enterprise-class relational database, compatible with MySQL and PostgreSQL. AWS quotes up to 5× the throughput of MySQL and 3× of PostgreSQL on the same hardware; treat that as a marketing figure that depends on the workload.

Key features (lesson 7.3):

  • Storage separated from compute: data is kept as 6 copies across 3 AZs, self-healing, and grows automatically in 10 GiB steps up to 128 TiB (256 TiB on recent engine versions; the notes say 128 TB).
  • Up to 15 Aurora Replicas with very low lag, auto scaling of replicas, writer and reader endpoints (and custom endpoints). Failover usually completes in under 30 seconds; the notes say “milliseconds”, which describes the replica lag, not the failover.
  • Aurora Serverless v2: capacity scales in seconds; for unpredictable or intermittent workloads with no capacity planning.
  • Global Database: one primary Region and up to 10 secondary Regions (each with up to 16 read instances), storage-level replication in under one second.
  • Also: backtrack and restore options, cloning (a new cluster from an existing one, faster than restoring a snapshot), Aurora machine learning (SageMaker, Comprehend, Bedrock from SQL), Babelfish for SQL Server apps.

Pick it when: the same uses as RDS, with less maintenance and more performance, availability and features.

Exam keywords: “PostgreSQL/MySQL compatible” plus “max performance”, “auto-scaling storage”, “15 replicas” → Aurora. “Global low-latency reads and Regional DR” → Aurora Global Database.

Not for: Oracle, SQL Server or Db2 without Babelfish (use RDS), or a tiny database where cost matters most.

#Amazon ElastiCache, and MemoryDB

What: a managed in-memory cache: it takes load off the database and brings response times from milliseconds down to microseconds. Engines: Valkey, Redis OSS and Memcached (lesson 7.5). You choose a node type (for example cache.m6g.large) or use ElastiCache Serverless.

The notes compare the two classic engines:

Redis (Valkey / Redis OSS)Memcached
PersistenceYes: snapshots, backup and restoreNo: pure in-memory; a restart wipes the data
Multi-AZ and failoverYes, with replicasNo replication or failover (nodes can sit in different AZs, but each holds different data)
Data structuresRich: sets, sorted sets, lists, hashes, geospatialSimple key-value strings
ThreadsCommands run on one thread (newer versions use extra threads for network I/O)Multi-threaded

Caching strategies: lazy loading (load into the cache only when a request misses) and write-through (update the cache whenever the database is written).

Pick it when: caching query results, frequent reads with fewer writes, session data for web servers, leaderboards and counters that can be rebuilt. It needs code changes in the app (the app talks to the cache), and it cannot run SQL.

Exam keywords: “session store”, “user profiles with persistence / Multi-AZ” → Redis; “pure caching, simple key-value, multi-threaded” → Memcached.

When the cache must be the database: MemoryDB. ElastiCache replicates asynchronously, so a failover can lose the last writes; it is a cache, a copy of data that lives elsewhere. MemoryDB is a Valkey- and Redis OSS-compatible primary database: every write is stored in a Multi-AZ transaction log before it is acknowledged, so data survives node and AZ failures. Reads are still microseconds; writes take single-digit milliseconds. Keywords: “durable in-memory database”, “Redis-compatible primary database”, “no data loss” → MemoryDB.

#Amazon DynamoDB

What: AWS’s fully managed, serverless NoSQL database for key-value and document data, with single-digit millisecond latency at any scale. Multi-AZ by default (lessons 15.4 and 15.5).

Key features:

  • Capacity modes: on-demand (scales automatically, pay per request) and provisioned (you set RCU and WCU, with optional auto scaling; the notes say provisioned is fixed, but auto scaling has long been available).
  • DAX: an in-memory cache with the DynamoDB API; read latency in microseconds.
  • DynamoDB Streams: every insert, update and delete becomes an event, for example to run a Lambda function (or Kinesis Data Streams).
  • Global Tables: multi-Region, active-active replication.
  • Transactions, TTL to expire items, PITR backups up to 35 days, on-demand backups, export to S3 and import from S3 without using capacity, IAM for all access control.

Pick it when: serverless apps, key lookups at any scale, spiky traffic, items up to a few hundred KB, rapidly evolving schemas. The slides add that DynamoDB can replace ElastiCache as a key-value store, for example for sessions with TTL, when you want the data to be durable and serverless.

Exam keywords: “serverless key-value store with massive scale” → DynamoDB; “microsecond latency” → DAX.

Not for: joins, ad-hoc reporting, items larger than 400 KB, free-text search.

#Amazon S3 and Glacier

What: serverless object storage: files, images, video and backups stored as objects in buckets (not block storage, not a file system). Durability is 99.999999999% (11 nines), objects can be up to 50 TB, and there is no capacity to plan. The slides describe S3 as a key-value store for objects: great for big objects, not for many tiny ones (chapter 10, starting at lesson 10.1).

The notes’ storage-class table, with the current facts (lesson 10.5):

Storage classUseMinimum storage durationRetrieval
S3 StandardFrequently accessed data, website assetsNoneInstant
S3 Intelligent-TieringUnknown or changing access patterns, saves cost automaticallyNone (the notes say 30 days; a small monitoring fee per object instead)Instant for the frequent and infrequent tiers
S3 Standard-IAInfrequently accessed, but needed immediately30 days (128 KB minimum billable size)Instant
S3 One Zone-IARe-creatable data in one AZ, about 20% cheaper than Standard-IA30 daysInstant
S3 Glacier Instant RetrievalArchives read about once a quarter, in milliseconds90 daysInstant
S3 Glacier Flexible RetrievalBackups90 daysMinutes (expedited) to 12 hours
S3 Glacier Deep ArchiveCheapest, long-term archive180 days12 hours (standard) to 48 hours (bulk)

S3 Object Lock stores objects as WORM (write once, read many): for a set period nobody can delete or overwrite them, for regulatory compliance. In compliance mode not even the root user can (lesson 10.9).

Exam keywords: “unknown access patterns” → S3 Intelligent-Tiering; “cheapest storage for long-term compliance backup” → S3 Glacier Deep Archive; “prevent deletion by any user including root” → S3 Object Lock in compliance mode.

Not for: a shared file system for servers (that is EFS or FSx, lessons 5.4 and 12.2), or many small updates inside files.

#The four purpose-built engines, in one line each

ServiceOne lineExam keyword
DocumentDBManaged JSON document database with the MongoDB API and Aurora-like storage“MongoDB compatible”, “migrate MongoDB workloads”
NeptuneManaged graph database for highly connected data“graph”, “social network”, “fraud rings”, Gremlin or SPARQL
KeyspacesServerless managed Apache Cassandra“existing Cassandra workload”, no servers to manage
TimestreamServerless time-series database“IoT sensors”, “metrics over time”, “time-stamped data”

All four, with real scenarios and their own animations, are in lesson 16.2.

#The decision map

Read the requirement, then walk these steps in order. The first step that matches usually gives the answer.

  1. Is it files or big objects?

    Photos, video, backups, logs, anything measured in megabytes or more: S3, with a storage class for the access pattern and Glacier classes for archives. The database keeps only the object key.

  2. Is it analytics over history rather than running the app?

    Reports, BI, dashboards over terabytes: Redshift. Occasional SQL over files already in S3: Athena. Never run it on the OLTP primary.

  3. Is it search?

    Free text, partial or fuzzy matching, relevance, log search: OpenSearch, fed from the source of truth.

  4. Does the data have a special shape, or an existing engine?

    Graph of relationships: Neptune. Time-stamped readings: Timestream. Existing MongoDB: DocumentDB. Existing Cassandra: Keyspaces. Oracle, SQL Server or Db2 kept as they are: RDS for that engine.

  5. Does it need joins, transactions across entities, or ad-hoc SQL?

    Yes: relational. Aurora for performance, many replicas, auto-growing storage and global reach; Aurora Serverless v2 for unpredictable load; RDS for commercial engines or a small, cheap, steady database.

  6. Is it looked up by key at large or spiky scale?

    DynamoDB (serverless, single-digit ms). Microsecond reads on it: DAX.

  7. Is it a fast copy, or must memory-speed data be durable?

    A cache, sessions, data you can rebuild: ElastiCache. An in-memory store that is the source of truth: MemoryDB.

#The keyword map

The notes end with a quick revision cheat sheet. Here it is, corrected and extended with the families from the slides:

The question says…Answer
SQL + high availability / failover in another AZRDS Multi-AZ
SQL + read scalingRead replicas (RDS) or Aurora Replicas
SQL + high performance, auto-growing storage, MySQL/PostgreSQL compatibleAurora
Relational + unpredictable or intermittent loadAurora Serverless v2
Relational + global reads + Regional DRAurora Global Database
OS or database root access, Oracle/SQL ServerRDS Custom
NoSQL key-value + millisecondDynamoDB
NoSQL key-value + microsecondDynamoDB + DAX
Multi-Region active-active NoSQLDynamoDB Global Tables
In-memory caching, session storeElastiCache (Valkey / Redis OSS or Memcached)
Durable in-memory primary databaseMemoryDB
Object storage, static files, backupsS3 (the notes say “object / file storage”: a shared file system is EFS or FSx)
Long-term archiveS3 Glacier classes (Deep Archive cheapest)
MongoDB compatibleDocumentDB
Graph / relationship dataNeptune
Cassandra workloadKeyspaces
IoT / time-stamped dataTimestream
Data warehouse, OLAP, BIRedshift
SQL directly on S3, serverlessAthena
Full-text search, log analyticsOpenSearch
Immutable, verifiable ledgerQLDB in older questions; retired in 2025
Migrate a database, change enginesDMS (+ SCT for a different engine), lesson 23.3

Now practise it. Each scenario below starts with the requirement, shows the tempting wrong answer failing, then the right one:

Exam keywords → the service (and the trap)

Each scenario is an exam-style requirement. Read the keywords under the stage, then watch the tempting wrong answer fail and the right one win, with the reason.

Scenario

joins, ACID transactions, MySQL compatible, 15 replicas, storage grows by itself

Requirement
Aurora
DynamoDB

Keywords in the question

Keywords

joins, ACID transactions, MySQL compatible, 15 replicas, storage grows by itself

Step 1 of 3
1

An e-commerce company moves its MySQL order system to AWS. It needs joins and transactions, up to 15 low-lag read replicas, storage that grows by itself, and the best performance.

And when there is no exam question, only your own app, answer the questions one at a time:

Database chooser

Answer a few questions about your data. You get the service to pick, why, the runner-up and why it lost. Click an earlier answer to go back and try another path.

Question 1:What does the data look like?

#What goes wrong

Most database trouble on AWS is not a bug in the database; it is a database used for something it was not built for. Six common wrong picks:

The wrong database, and what to use instead

Each scenario starts with a store that seems fine on day one and breaks as the data or the questions grow. The top node is the wrong pick, the bottom node is the right one.

Scenario

A key-value store has no joins; new questions turn into scans.

App
DynamoDBorders table5 ms
Aurorarelational
GetItem
Step 1 of 4
1

A team stored orders in DynamoDB because “it scales”. Fetching one order by its key is fast. Then the manager asks: “total sales per district, with customer names and product categories”.

SymptomCauseFix
Checkout times out every month endReports run on the OLTP primaryReports on a read replica for small jobs; Redshift (zero-ETL) or Athena for real analytics
A new report needs a full table Scan in DynamoDB and a pile of codeRelational, ad-hoc questions on a key-value storeModel data for known access patterns, or keep relational data in Aurora/RDS; export to S3 for analytics
A leaderboard or cart vanished after a cache node was replacedElastiCache used as the only copyMemoryDB, or a durable database with the cache in front
Search is slow, misses plurals and typosLIKE with a leading wildcard on RDSOpenSearch fed from RDS
“Accounts within six hops” query times outGraph traversal written as self-joinsNeptune (lesson 16.2)
RDS table grows by hundreds of millions of rows a day; time-window queries crawlTime-series data in a general-purpose tableTimestream (lesson 16.2), or partitioning and archiving to S3
Backups and restores take hours; storage bill keeps risingPhotos and files stored inside the databaseS3 for objects, keys in the database
A DynamoDB write fails with an item-size errorItem over 400 KBStore the payload in S3, keep a pointer in the item
Search shows an item “in stock” that sold outThe search index (a copy) lags the source of truthCheck the source of truth inside the transaction; alarm on sync lag
Licence bill for SQL Server dominates the budgetCommercial engine kept by habitAurora PostgreSQL with Babelfish, migrated with DMS and SCT (lesson 23.3)
The design depends on QLDBService retired in July 2025Aurora PostgreSQL with audit history, S3 Object Lock for tamper-proof exports

#Databases in system design

  • One store per job, one source of truth per fact. Polyglot persistence is normal, but every fact needs exactly one home. Caches, search indexes and warehouses are copies fed from it, and every copy lags a little.
  • Let the data model and access pattern decide, not fashion. “It scales” is not a reason to choose DynamoDB for relational data; “we know SQL” is not a reason to keep graph or time-series data in RDS.
  • Separate OLTP from OLAP from day one. Even a small shop should send reports to a replica, and grow into Redshift or Athena.
  • Serverless where load is unpredictable. DynamoDB on-demand, Aurora Serverless v2, ElastiCache Serverless, Athena: capacity follows traffic.
  • Encryption and access the same way everywhere: KMS keys for data at rest (chapter 21, lesson 21.2), TLS in transit, IAM and security groups for access.
  • Moving off old engines: DMS copies the data with little downtime, SCT converts the schema when the engine changes (Oracle to Aurora PostgreSQL), Babelfish keeps SQL Server apps running on Aurora (lesson 23.3).

Here is a single shop using six stores, and two things that go wrong with copies:

One online shop, the right store for each job

A Dhaka fashion shop does not pick “a database”. Each feature uses the store that fits its data and its questions, and Aurora stays the source of truth for money and stock.

Scenario

Sessions in a cache, product search in a search engine.

ElastiCachesessions< 1 ms
Shop backend
OpenSearchproduct search
DynamoDBcarts
Auroraorders, stock
Redshiftreports
save session
Step 1 of 2
1

A shopper logs in. The session goes to ElastiCache, so any backend instance behind the load balancer can read it in under a millisecond (lesson 9.2).

#Try it yourself

#Exercise: pick the store

Answer each before reading the solution below the list.

  1. A university stores exam results with students, courses and semesters, and the registrar runs new queries every term.
  2. A mobile game needs each player’s inventory, read and written by player ID, 200,000 times a second at launch.
  3. The same game’s global top-100 leaderboard must update in real time; it can be rebuilt from the inventories.
  4. A bank must find accounts connected to a known mule account within four transfers.
  5. A logistics company keeps 7 years of delivery records for audit, almost never read.
  6. A marketing team wants to ask SQL questions about last month’s app logs, already in S3, twice a month.

Solutions: (1) Aurora or RDS, relational with ad-hoc queries; (2) DynamoDB on-demand, key access at scale; (3) ElastiCache sorted set (rebuildable), or MemoryDB if it must be durable; (4) Neptune; (5) S3 Glacier Deep Archive, with Object Lock if it must be tamper-proof; (6) Athena.

#See what is on offer in your Region

These read-only commands show the engines and versions each service offers. Region ap-southeast-1; outputs are shortened.

# RDS engines and versions (Db2 included)
aws rds describe-db-engine-versions --query 'DBEngineVersions[].Engine' --output text | tr '\t' '\n' | sort -u
#   aurora-mysql  aurora-postgresql  custom-oracle-ee  custom-sqlserver-ee  db2-ae  db2-se
#   mariadb  mysql  oracle-ee  oracle-se2  postgres  sqlserver-ee  sqlserver-ex  sqlserver-se  sqlserver-web

# Aurora PostgreSQL versions
aws rds describe-db-engine-versions --engine aurora-postgresql \
  --query 'DBEngineVersions[-3:].EngineVersion'
#   [ "16.6", "17.4", "17.5" ]

# ElastiCache and MemoryDB engines (Valkey is there)
aws elasticache describe-cache-engine-versions --query 'CacheEngineVersions[].Engine' --output text | tr '\t' '\n' | sort -u
#   memcached  redis  valkey
aws memorydb describe-engine-versions --query 'EngineVersions[].[Engine,EngineVersion]' --output text
#   redis   7.0
#   redis   7.1
#   valkey  7.2

# DocumentDB and Neptune use the RDS-style API (details in lesson 16.2)
aws docdb describe-db-engine-versions --query 'DBEngineVersions[].EngineVersion'
#   [ "4.0.0", "5.0.0", … ]   (lesson 16.2 checks which versions are current)
aws neptune describe-db-engine-versions --query 'DBEngineVersions[-1].EngineVersion'
#   "1.4.5.1"

# DynamoDB: one table, nothing to size in on-demand mode
aws dynamodb create-table --table-name carts-example \
  --attribute-definitions AttributeName=shopperId,AttributeType=S \
  --key-schema AttributeName=shopperId,KeyType=HASH \
  --billing-mode PAY_PER_REQUEST
#   "TableStatus": "CREATING", "BillingModeSummary": { "BillingMode": "PAY_PER_REQUEST" }
aws dynamodb delete-table --table-name carts-example

Version numbers change often; what matters is the shape. RDS, Aurora, DocumentDB and Neptune ask for engines, versions and instances. DynamoDB asked only for a key.

#Summary

Key takeaways

  • Choose by asking: read/write mix, throughput and spikes, size and growth, object size, access pattern, durability and source of truth, latency, concurrency, data model, joins, schema, reporting, search, licence cost.
  • OLTP (many small ACID transactions, row store) → RDS / Aurora. OLAP (big questions over history, columnar) → Redshift; SQL on files in S3 → Athena. Never run reports on the OLTP primary.
  • NoSQL families: key-value DynamoDB, in-memory ElastiCache / MemoryDB, document DocumentDB, wide-column Keyspaces, graph Neptune, time series Timestream. Plus object S3/Glacier and search OpenSearch.
  • RDS: six engines incl. Db2; Multi-AZ = synchronous, HA within a Region; read replicas = async, up to 15; PITR 1–35 days; RDS Custom for OS access.
  • Aurora: MySQL/PostgreSQL compatible, 6 copies in 3 AZs, storage to 128 TiB (256 TiB new), 15 replicas, failover under 30 s, Serverless v2, Global Database.
  • ElastiCache = cache (Redis/Valkey: persistence, Multi-AZ, data structures; Memcached: simple, multi-threaded). MemoryDB = durable in-memory primary database.
  • DynamoDB: serverless key-value, single-digit ms, on-demand or provisioned (+ auto scaling), DAX for µs, Streams, Global Tables, 400 KB items.
  • S3: 11 nines, objects to 50 TB; Intelligent-Tiering for unknown patterns (no minimum duration), Deep Archive cheapest, Object Lock compliance mode stops even root.
  • QLDB ended support in July 2025 (Aurora PostgreSQL recommended). Aurora DSQL and Valkey are new; the exam answers remain Global Database and “Redis”.