AWS Database Services

RDS, Aurora, DynamoDB, Redshift and the specialised and migration database services.

What is it?

AWS offers purpose-built databases, not one-size-fits-all.

  • Amazon RDS: managed relational databases (MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Db2). AWS handles backups, patching and failover (Multi-AZ); you manage schema and queries.
  • Amazon Aurora: AWS's cloud-built relational engine, compatible with MySQL and PostgreSQL, with storage replicated across AZs and fast failover.
  • Amazon DynamoDB: serverless key-value and document NoSQL database with single-digit-millisecond performance at nearly any scale.
  • Amazon Redshift: data warehouse for analytic SQL over large datasets.
  • Amazon ElastiCache: managed in-memory cache (Valkey, Redis OSS and Memcached engines) that caches hot data to cut latency and database load. DAX is an in-memory cache just for DynamoDB.
  • Amazon MemoryDB: a durable, Redis-compatible in-memory database that can be the primary store.
  • Amazon DocumentDB: MongoDB-compatible document database.
  • Amazon Neptune: graph database for highly connected data such as fraud rings, social networks and recommendations (queried with Gremlin, openCypher or SPARQL).
  • Amazon Keyspaces: managed Cassandra-compatible database.
  • Amazon Timestream: time-series data that changes over time, such as IoT sensor readings.

Migration helpers: AWS Database Migration Service (DMS) moves data between databases, often with little downtime. AWS Schema Conversion Tool (SCT) / DMS Schema Conversion converts schema and code when engines differ (for example Oracle to Aurora PostgreSQL).

Note: Amazon QLDB (a ledger database with an immutable, cryptographically verifiable journal) reached end of support in July 2025; AWS suggests Aurora PostgreSQL for ledger-style needs. Treat it as retired in older material. Service lineups change, so check current docs.

EC2-hosted vs managed databases: you can install a database on an EC2 instance, but then you handle patching, backups, high availability, replication and scaling yourself. RDS, Aurora or DynamoDB automate those tasks. Self-host only for unsupported engines, full OS access or special licensing.

Database vocabulary the exam assumes

  • Relational (OLTP): tables, rows and columns, stored row by row and queried with SQL. What people usually mean by 'a database' (PostgreSQL, MySQL). Good for many small, real-time transactions.
  • Data warehouse (OLAP): also relational, but stored column by column so it aggregates huge datasets (totals, averages) fast. Data is loaded from other systems via ETL/ELT, and it serves reports and analysis, not live transactions. On AWS: Redshift.
  • Key-value (NoSQL): a key and a value. Very fast and scales well, but no joins. Schemaless, so items can have different attributes.
  • Document (NoSQL): a key-value store holding JSON-like documents. Tables become collections, rows documents, columns fields; joins are replaced by embedding or linking.
  • Wide-column (Keyspaces, Cassandra-compatible), graph (Neptune) and time-series (Timestream) cover other shapes.

DynamoDB details: every table needs a partition key and optionally a sort key. Capacity is on-demand (pay per request, the most serverless option) or provisioned (set read and write capacity, optionally with auto scaling).

It encrypts at rest by default and supports secondary indexes, time-to-live (TTL) expiry, deletion protection and PartiQL, a SQL-compatible query language. You manage no shards or servers, which is why it is AWS's go-to answer for 'massively scalable' NoSQL.

RDS and Aurora details:

  • Oracle and SQL Server on RDS need a licence (license-included or bring your own).
  • Aurora is MySQL- and PostgreSQL-compatible, faster than the standard engines, and built for high availability and durability, at a higher price than basic RDS.
  • Aurora Serverless v2 scales capacity up and down in place almost instantly, suiting variable or infrequent workloads (the cold-start behaviour some material mentions applied to v1, now end of life).
  • RDS Proxy pools and shares connections, protecting a database from being flooded by many Lambda functions.
  • Store credentials in AWS Secrets Manager, keep the database private in the VPC, and connect from an app server (PostgreSQL listens on port 5432 by default).

Redshift details: petabyte-scale and fast for complex analytical queries, but it can be expensive, so delete trial clusters (or use Redshift Serverless). Data usually loads from S3 with the COPY command, and Query Editor v2 runs SQL and charts results in the browser.

Explain like I'm 10

Choosing a database is like choosing storage furniture. A relational database is a filing cabinet with labeled, linked folders and strict forms. DynamoDB is a wall of numbered lockers: very fast to open by number, but not for complicated questions. Redshift is a reading room where analysts compare thousands of books at once. A cache is the sticky note on your monitor.

Examples

Create a DynamoDB table and use it

aws dynamodb create-table --table-name Orders \
  --attribute-definitions AttributeName=customerId,AttributeType=S AttributeName=orderId,AttributeType=S \
  --key-schema AttributeName=customerId,KeyType=HASH AttributeName=orderId,KeyType=RANGE \
  --billing-mode PAY_PER_REQUEST

aws dynamodb put-item --table-name Orders \
  --item '{"customerId":{"S":"c-1"},"orderId":{"S":"o-100"},"total":{"N":"42.5"}}'

aws dynamodb query --table-name Orders \
  --key-condition-expression "customerId = :c" \
  --expression-attribute-values '{":c":{"S":"c-1"}}'

Access patterns drive the key design: query by partition key (customer), sort by order id.

Which database?

Need                                               Choose
-------------------------------------------------  ---------------------
Familiar SQL, existing engine, managed backups     RDS
High-performance MySQL/PostgreSQL, fast failover   Aurora
Huge scale key-value, serverless, ms latency       DynamoDB
Analytics across billions of rows                  Redshift
Speed up repeated reads                            ElastiCache / DAX
Social graph, fraud rings                          Neptune
Move Oracle to PostgreSQL                          SCT + DMS

How it works

RDS runs a database engine on managed instances. Multi-AZ keeps a standby in another AZ and fails over automatically; read replicas scale reads. Aurora separates compute from a shared, replicated storage layer that grows automatically. DynamoDB partitions data by key across many servers and replicates it across AZs; you pay per request or provision capacity.

Redshift stores data in columns and spreads queries across nodes, so aggregates are fast. Caches sit in front of a database and answer repeat reads from memory.

  App --> ElastiCache / DAX (hot reads)
     |
     +--> RDS / Aurora   (relational, SQL, transactions)
     +--> DynamoDB       (key-value, scale-out)
     '--> Redshift       (analytics, columns)

  On-prem DB --[SCT convert schema]--> [DMS replicate] --> target DB

Why does it exist?

Running databases yourself means patching, backups, failover and capacity planning. Managed databases remove that, and specialised engines fit each data shape far better than one model for everything.

When to use it

Pick by data shape and access pattern: relational for joins and transactions, DynamoDB for predictable key-based access at scale, Redshift for analytics, caches to speed up reads.

When not to use it

Don't use DynamoDB for ad-hoc relational queries over many fields. Don't use RDS for petabyte-scale analytics. Don't run your own database on EC2 unless you need control a managed service can't give.

Common mistakes

  • Using a relational database for everything out of habit, or NoSQL without defining access patterns first.

  • Believing Multi-AZ improves read throughput (read replicas do; Multi-AZ is for availability).

  • Skipping backup and retention settings review.

  • Leaving a database publicly accessible.

  • Treating DMS as a schema converter (that is SCT's job).

  • Choosing Redshift for an app's live transactions; it is built for analytics (OLAP), not OLTP.

  • Expecting joins in DynamoDB; model your data around access patterns instead.

  • Opening a database to the internet so a laptop can connect, instead of connecting through an app server or bastion in the VPC.

  • Letting thousands of Lambda invocations open their own database connections; use RDS Proxy.

  • Installing a database on EC2 'to save money' and forgetting the staff time for backups, patching and failover.

Practice exercises

  1. Easy:

    Match each to a database: shopping-cart sessions with millisecond reads, a monthly sales report across years of data, a friend-of-friend recommendation.

  2. Medium:

    Explain Multi-AZ vs read replica and when you would use each.

  3. Medium:

    Design a DynamoDB key schema for 'get all orders for a customer, newest first'.

  4. Hard:

    Plan a migration from on-premises Oracle to Aurora PostgreSQL using SCT and DMS, including how to minimise cutover downtime.

Interview questions

RDS vs DynamoDB?

RDS is managed relational SQL with joins and transactions; DynamoDB is a serverless key-value/document store that scales horizontally for known access patterns.

What is DMS?

A service that migrates data between databases, including continuous replication to reduce downtime.

What does ElastiCache provide?

A managed in-memory cache (Valkey, Redis OSS or Memcached) to cut read latency and database load.

Exam-style: Which service is a petabyte-scale data warehouse?

Amazon Redshift.

Exam-style: Which service converts a database schema when migrating between engines?

AWS Schema Conversion Tool (SCT).

Exam-style: Which service reduces read latency with an in-memory cache in front of a database?

Amazon ElastiCache.

Exam-style: What is the main advantage of RDS over a database on EC2?

AWS automates patching, backups, replication and failover, reducing operational overhead.

Exam-style: Which database is MongoDB-compatible?

Amazon DocumentDB.

Exam-style: Which database is Apache Cassandra-compatible?

Amazon Keyspaces.

Exam-style: Which database stores IoT sensor readings that change over time?

Amazon Timestream.

Exam-style: A company needs a serverless NoSQL database with single-digit-millisecond latency at any scale. Which service?

Amazon DynamoDB.

Exam-style: Which database best detects fraud rings by analysing relationships between accounts?

Amazon Neptune (graph database).

OLTP vs OLAP?

OLTP handles many small real-time transactions in a row-oriented relational database (RDS, Aurora). OLAP runs large analytical aggregations over column-oriented data (Redshift).

What are DynamoDB's two capacity modes?

On-demand (pay per request) and provisioned (set read/write capacity, optionally with auto scaling).