Databases
The kinds of database AWS offers, the questions that decide which one fits, and the pages in this group.
What it is
A database keeps an application's data and answers questions about it. AWS runs many kinds of database as managed services: AWS handles the servers, patching, backups and replication, and the customer works with the data.
There's no single best database. Each kind is built for a shape of data and a way of reading it. Choosing well is a big part of the exam, so this page starts with the map.
Database types
- Relational (SQL, OLTP): tables with a fixed schema, joined with SQL, with transactions. Good for orders, accounts and anything with relationships between records. RDS and Aurora.
- Key-value (NoSQL): look up an item by its key, at any scale, with no joins. DynamoDB.
- In-memory: data kept in RAM for sub-millisecond reads, mostly as a cache in front of another database. ElastiCache.
- Document: JSON documents with flexible fields, queried by any field. DocumentDB (MongoDB-compatible).
- Graph: things and the links between them, for questions like "friends of friends". Neptune.
- Wide-column: Apache Cassandra tables, for huge write-heavy workloads. Keyspaces.
- Time series: values measured over time, such as sensor readings. Timestream.
- Data warehouse (OLAP): SQL analytics over large amounts of history. Redshift, covered with Athena and EMR in the Analytics group.
- Object storage (S3) and search (OpenSearch) also hold data, and are covered in their own groups.
Updated since the slides
The slides list Amazon Quantum Ledger Database (QLDB) for ledger data. AWS has discontinued QLDB: its page now points to Aurora PostgreSQL instead. It isn't needed for the exam.
Choosing the right database
Before picking a service, answer these questions about the workload:
- Reads and writes: read-heavy, write-heavy or balanced? How much throughput, and does it change during the day?
- Size and growth: how much data, for how long, and how big is each item? How is it accessed?
- Durability: is this the source of truth, or a copy that can be rebuilt (a cache)?
- Latency and concurrency: milliseconds or microseconds? How many users at once?
- Data model: structured, semi-structured or connected? Are joins needed, or simple lookups by key?
- Schema: fixed and strict, or changing often? Is reporting or search needed?
- Licences: paying for Oracle or SQL Server licences? Moving to Aurora removes them.
Example
An online shop might use three databases. Orders and payments live in Aurora, because they need transactions and joins. The shopping cart and session data live in DynamoDB, because every request reads one cart by its key. Product pages are cached in ElastiCache, so the database isn't asked for the same page thousands of times a minute.
In this group
Relational: RDS
Amazon RDS
Managed MySQL, PostgreSQL, MariaDB, Oracle, SQL Server and Db2.
Read replicas and Multi-AZ
Scale reads, survive an AZ failure, and RDS Custom.
Relational: Aurora
Amazon Aurora
Six copies across three AZs, endpoints, replica auto scaling.
Aurora advanced
Serverless, Global Database, Aurora ML and Babelfish.
RDS and Aurora operations
Backups, restore and cloning
Automated backups, snapshots, restore from S3, Aurora clones.
Security and RDS Proxy
Encryption, IAM authentication, and connection pooling.
Caching
NoSQL
Amazon DynamoDB
Serverless key-value tables, keys and capacity modes.
DynamoDB advanced
DAX, Streams, global tables, TTL, backups and S3.
DocumentDB, Neptune, Keyspaces
Document, graph and Cassandra databases.
Amazon Timestream
Time series data, now Timestream for InfluxDB.
Each service in one line
- RDS: managed relational database for MySQL, PostgreSQL, MariaDB, Oracle, SQL Server or Db2. The instance size and storage are chosen. For SQL, joins and transactions.
- Aurora: AWS's own MySQL- and PostgreSQL-compatible engine. Storage is separate from compute and kept in six copies; more performance and less management than RDS.
- ElastiCache: managed Valkey, Redis OSS or Memcached. In-memory key-value store, sub-millisecond. Needs application code changes.
- DynamoDB: serverless NoSQL key-value tables, single-digit millisecond at any scale. Great for serverless apps and fast-changing schemas.
- DocumentDB: MongoDB-compatible document database. Neptune: graph database. Keyspaces: Cassandra-compatible tables. Timestream: time series.
- S3: objects of any size by key; great for big files, not for many tiny items. Covered in the Amazon S3 group.
Exam tips
- "Relational", "SQL", "joins", "transactions", "OLTP" → RDS or Aurora.
- "MySQL or PostgreSQL with the best performance and availability", "less management" → Aurora.
- "Oracle or SQL Server with access to the operating system" → RDS Custom.
- "Serverless NoSQL", "key-value", "millions of requests per second", "schema changes often" → DynamoDB.
- "Cache", "sub-millisecond", "session store", "reduce database load" → ElastiCache (or DAX for DynamoDB).
- "MongoDB" → DocumentDB. "Graph", "relationships", "social network", "fraud rings" → Neptune. "Cassandra", "CQL" → Keyspaces. "Time series", "IoT sensor data" → Timestream.
- "Analytics", "data warehouse", "OLAP", "BI" → Redshift.
Common traps
- "DynamoDB for complex joins and reporting." DynamoDB has no joins; use a relational database or Redshift.
- "ElastiCache as the main database." It's a cache: fast, but the source of truth should be a durable database.
- "RDS for a schema that changes every week with millions of writes a second." That's a NoSQL workload; DynamoDB fits better.
AWS documentation
Scaling policies
How Auto Scaling groups decide to scale, with CloudWatch alarms, target tracking, step, scheduled and predictive policies, good metrics, cooldowns, warm pools, instance refresh, and AWS Auto Scaling.
Amazon RDS
What Amazon RDS manages, the six engines, instance and storage choices, storage auto scaling, and why it can't be reached over SSH.