Solutions Architect

Databases

Matching the engine to the access pattern, then scaling it for reads, writes and connections. Part of Domain 3: Design High-Performing Architectures, 24% of the scored content.

Amazon RDS

Amazon Relational Database Service

Official page

Managed relational databases on instances that you size. You choose the engine, the instance class and the storage, and AWS runs patching, backups and failover.

Key points

  • Engines: Db2, MariaDB, MySQL, Oracle, PostgreSQL and SQL Server. Pick PostgreSQL for advanced SQL, extensions and complex queries, MySQL or MariaDB for simple, widely supported web workloads, and Oracle or SQL Server when licenses or features require them.
  • Instance classes: general purpose (db.m*), memory optimized (db.r*, db.x*, db.z1d), burstable (db.t*) and Optimized Reads classes with local NVMe. Scale up by changing the class.
  • Read replicas: asynchronous copies that serve reads, up to 15 per source (Db2 up to 3). They can live in another AZ or another Region and can be promoted to a standalone instance for DR. RDS does not add or remove replicas automatically.
  • Storage autoscaling: grows storage when free space is at or below 10% for at least 5 minutes, up to the maximum storage threshold you set. It never shrinks storage.
  • Magnetic storage is deprecated. New instances use gp3 or Provisioned IOPS SSD.

On the exam

"Reporting queries slow down the production database" -> read replica, not Multi-AZ (the Multi-AZ standby instance serves no reads). "Consistent low-latency I/O for OLTP" -> Provisioned IOPS (io2 Block Express), not gp2.

RDS storage types

TypeWhen to use
gp3Default choice. Baseline 3,000 IOPS and 125 MiB/s, more provisioned independently of size (up to 64,000 IOPS).
gp2Previous generation. 3 IOPS per GiB, bursts to 3,000 IOPS on small volumes.
io2 Block ExpressI/O-intensive OLTP. Up to 256,000 IOPS with sub-millisecond latency. Recommended Provisioned IOPS type.
io1Previous generation Provisioned IOPS. Up to 256,000 IOPS, single-digit ms latency.
Official page

MySQL and PostgreSQL compatible engine with a distributed storage layer shared by the writer and all readers, which makes replicas cheap and failover fast.

Key points

  • Storage: 6 copies of the data across 3 AZs in a cluster volume that grows automatically, up to 256 TiB on recent engine versions.
  • Aurora Replicas: up to 15 per cluster, lag usually much less than 100 ms. The reader endpoint spreads connections across them and failover promotes one by priority (tier 0 is highest).
  • Aurora Serverless v2: capacity in ACUs (about 2 GiB of memory each) from 0 to 256, scaling in steps as small as 0.5 ACU. At 0 ACU the instance pauses on supported versions.
  • Global Database: up to 10 secondary Regions with replication typically under 1 second, RPO of 1 second and RTO under 1 minute. Up to 16 read-only instances per secondary. Write forwarding sends writes to the primary.
  • I/O-Optimized: no charge for read and write I/O. Worth it when I/O is 25% or more of the Aurora bill (savings up to 40%). Standard to I/O-Optimized once every 30 days.

On the exam

"Unpredictable or spiky relational load, pay for what is used" -> Aurora Serverless v2. "Global reads with sub-second lag and Regional DR" -> Aurora Global Database, not cross-Region RDS read replicas.

Official page

Serverless key-value and document database with single-digit millisecond latency at any scale. Performance depends on capacity mode and on how evenly the partition key spreads traffic.

Key points

  • On-demand: pay per request, no capacity planning, for unknown or spiky traffic. Provisioned: set RCUs and WCUs, with auto scaling, for predictable traffic at lower cost. Provisioned to on-demand up to 4 times per 24 hours, back at any time.
  • RCU: 1 strongly consistent read or 2 eventually consistent reads per second of an item up to 4 KB. WCU: 1 write per second of an item up to 1 KB. Transactions cost 2x.
  • Partition key: choose a high-cardinality attribute (user ID, device ID) so requests spread across partitions. A low-cardinality key creates hot partitions and throttling.
  • Item size: up to 400 KB. Store large objects in S3 and keep the key in the item.
  • PITR: restore to any second in a recovery period you set from 1 to 35 days.

On the exam

"Millions of requests per second, schemaless, single-digit ms" -> DynamoDB, not RDS. Throttling on a few keys points to a bad partition key, not to a lack of total capacity.

Official page

Indexes, caching, change streams, expiry and multi-Region replication extend DynamoDB beyond simple key lookups.

Key points

  • GSI: different partition and sort key, created at any time, eventually consistent reads only, its own capacity. Default quota of 20 per table.
  • LSI: same partition key, different sort key, created only with the table, supports strongly consistent reads. Up to 5 per table and 10 GB per partition key value.
  • DAX: in-memory cache in front of DynamoDB, API compatible, microsecond reads, up to 10x faster.
  • Streams: ordered item changes kept for 24 hours, consumed by Lambda for event-driven processing. TTL deletes expired items within a few days, without consuming write throughput.
  • Global tables: multi-active, multi-Region replicas. Default MREC replicates typically within a second. MRSC gives strong consistency across Regions, chosen at creation.

On the exam

"Read-heavy DynamoDB, microsecond latency, no code change" -> DAX, not ElastiCache. "Query by another attribute after the table exists" -> GSI (an LSI cannot be added later).

Official page

Managed in-memory cache with Valkey, Redis OSS or Memcached. It offloads repeated reads from databases and stores sessions, with node-based or serverless deployment.

Key points

  • Valkey or Redis OSS: replication, automatic failover across AZs, backup and restore, pub/sub and sorted sets (leaderboards). Global Datastore replicates across Regions.
  • Memcached: multithreaded and simple, no replication and no failover. Fits a plain object cache that can be lost.
  • Lazy loading (cache-aside): read the cache, on a miss read the database and fill the cache. Only requested data is cached, but data can be stale and misses cost 3 trips.
  • Write-through: update the cache on every database write. Data is never stale, but every write takes 2 trips and unread data fills the cache.
  • TTL: add an expiry to either strategy to bound staleness and free memory.

On the exam

"Leaderboard, sorted ranking, HA cache, session store with failover" -> ElastiCache for Valkey or Redis OSS. "Simple multithreaded cache, no persistence" -> Memcached.

Official page

Each data model has its own managed engine. The exam describes the data and the queries and expects the matching service.

Key points

  • Amazon DocumentDB: JSON documents with MongoDB compatibility.
  • Amazon Keyspaces: serverless, Apache Cassandra compatible wide-column store.
  • Amazon Neptune: graph database for highly connected data, queried with Gremlin, openCypher or SPARQL.
  • Amazon Redshift: columnar data warehouse for analytics (OLAP) over large data sets, not for transactions.

On the exam

"Migrate MongoDB with minimal changes" -> DocumentDB. "Cassandra workload, no servers" -> Keyspaces. "Social network, fraud rings, recommendations" -> Neptune.

Requirement to database

RequirementChoice
Relational, joins, transactionsRDS or Aurora
Key-value at any scaleDynamoDB
Sub-millisecond cacheElastiCache, or DAX for DynamoDB
Documents (MongoDB)DocumentDB
Wide-column (Cassandra)Keyspaces
Graph relationshipsNeptune
Analytics on terabytesRedshift

RDS Proxy

Amazon RDS Proxy

Official page

Managed connection pool between the application and the database. It absorbs connection storms and keeps connections open during failover.

Key points

  • Connection pooling: many short-lived clients (Lambda functions) share a small set of database connections.
  • Failover: reduces failover time by up to 66% for Aurora and RDS.
  • Security: credentials stay in AWS Secrets Manager and IAM authentication can be enforced. The proxy is never publicly accessible and runs in the database VPC.
  • Engines: Aurora MySQL, Aurora PostgreSQL, RDS for MySQL, PostgreSQL, MariaDB and SQL Server.

On the exam

"Lambda functions exhaust database connections" or "too many connections errors" -> RDS Proxy, not a larger instance class.

Database migration

AWS Database Migration Service

Official page

AWS DMS moves data into AWS while the source stays operational. Changing the engine also requires converting the schema and code.

Key points

  • Homogeneous: same engine (MySQL to RDS for MySQL). DMS or the native engine tools move the data.
  • Heterogeneous: different engine (Oracle to Aurora PostgreSQL). Convert schema and code with DMS Schema Conversion or the AWS Schema Conversion Tool, then move the data with DMS.
  • CDC: change data capture keeps replicating ongoing changes for a near-zero downtime cutover.
  • Source stays online: applications keep using the source during the migration.

On the exam

"Oracle to PostgreSQL with minimal downtime" -> DMS Schema Conversion (or SCT) + DMS with CDC. DMS alone does not convert stored procedures or schema.