Skip to Content
Cloud Engineering Academy
6. Databases & Data Architecture

Choosing a database: SQL vs NoSQL on AWS

Use a repeatable decision framework (access patterns, consistency, scale, operations and cost) to choose between RDS, Aurora, DynamoDB, ElastiCache, DocumentDB, Redshift and S3 for a banking workload, and record the choice in an ADR.

beginner⏱ 1 h 30 min🟢 FreeSAA-C03DEA-C01DVA-C03

Assumes: .NET 10 LTS · AWS SDK for .NET v4 · AWS CLI v2 · Region us-east-1. Verified against official sources on 2026-11-18.

Learning objectives

By the end of this lesson you can:

  • Describe the AWS database family in one sentence each: RDS, Aurora, Aurora DSQL, DynamoDB, ElastiCache, DocumentDB, Redshift, S3 and the specialist stores (Neptune, Timestream, Keyspaces, MemoryDB).
  • Explain SQL vs NoSQL in terms of what each optimises for, not in terms of fashion.
  • Apply a five-question decision framework: access patterns, consistency, scale, operations, cost.
  • Map typical Harbourline Bank workloads (ledger, payment status, sessions, statements, analytics, product catalogue) to a store, and say why the alternatives lose.
  • Write an Architecture Decision Record (ADR) that an architect, an auditor and your future self can read.

Prerequisites

  • Module 6 overview, for what the module covers and how much it costs
  • Module 1: AWS fundamentals, for Regions, Availability Zones and the shared responsibility model
  • No AWS resources are created in this lesson. The exercises are design work, plus one optional free CLI command.

Why this matters in banking

Picture Harbourline's first cloud project. A team moves the payments status API to AWS and picks DynamoDB, because "it scales and it's serverless". Six months later, operations asks a simple question: "Show me every payment over £10,000 to a new beneficiary last quarter, grouped by branch." The table was designed for one access pattern, "get payment by ID", so the answer needs a full table scan, an export to S3 and an Athena query. The auditor waits two days.

Down the corridor, another team puts session tokens and rate-limit counters into the same SQL Server-style relational database that holds the ledger. On payday traffic spikes, the counters cause lock contention, and posting latency triples.

Neither team chose a bad database. Each chose a database that did not fit its access patterns. In a bank, a wrong choice shows up as:

  • month-end jobs that never finish;
  • double-posted payments when two writers race;
  • a restore that takes a day when the business expected an hour;
  • an audit request you can't answer without an engineering project.

The fix is not "always use SQL" or "always use NoSQL". It is a decision process you can repeat and defend.

The idea in plain language

A database is a promise about how data will be stored and found again. Different databases make different promises:

  • Relational (SQL) databases promise that you can ask almost any question later. You store normalised tables, and the engine works out at query time how to join, filter and aggregate them. The price is that one server (or one writer) does most of the work, so write scale has a ceiling. Costs are mostly fixed: you pay per hour for the instance whether you use it or not.
  • Key-value and document (NoSQL) databases like DynamoDB promise that the questions you designed for will be fast at any scale. You decide the access patterns first and shape the data around them. Questions you didn't plan for are slow or impossible without moving the data elsewhere.
  • Caches promise speed, not durability. They hold copies of data that lives somewhere else.
  • Warehouses and lakes promise cheap, fast analysis of large amounts of history. They are not built for thousands of small writes per second.

Analogy: A relational database is a well-run branch archive with a librarian. You can ask for "all letters to customers in Leeds about mortgages in 2019" and the librarian finds them, although it may take a while if the archive is huge. DynamoDB is a wall of numbered safe-deposit boxes. Opening box 4,217 takes the same instant whether there are a thousand boxes or a billion. But if you ask "which boxes contain mortgage letters?", someone has to open every box, unless you planned an index of exactly that question when you built the wall.

The skill this lesson teaches is to write down the questions first and choose the store second.

What problem the AWS database family solves

On-premises you probably ran one engine (SQL Server) for nearly everything, because every new engine meant new servers, licences, backups and DBA skills. AWS offers purpose-built managed databases. Each has its own operating model, and AWS runs the undifferentiated work: hardware, patching, backups and replication. That changes the economics. Using two engines is no longer twice the operational burden, so you can match each workload to the store that suits it.

Here is the family, in one sentence each.

ServiceWhat it isTypical banking useWatch out for
Amazon RDSManaged instances of PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and Db2Core ledger, customer master, anything relational with moderate scaleYou still choose an instance size and pay per hour; one writer
Amazon AuroraAWS-built relational engine compatible with PostgreSQL or MySQL. Its storage is spread over three AZsLedger needing fast failover, read scaling, cross-Region DR (Global Database)Higher minimum cost than small RDS; not SQL Server
Aurora DSQLServerless, distributed SQL database, PostgreSQL-compatible, active-active across Regions (GA May 2025)Multi-Region active-active systems of recordSupports only a subset of PostgreSQL features. Check every feature you rely on
Amazon DynamoDBServerless key-value and document store with single-digit-millisecond reads at any scalePayment status, idempotency keys, device and session records, event-sourced projectionsYou model access patterns first; ad-hoc queries are expensive
Amazon ElastiCacheManaged Valkey, Redis OSS or Memcached, in memoryCache-aside for reference data, rate limiting, short-lived sessionsNot a system of record; eviction and failover can lose data
Amazon MemoryDBDurable, Valkey/Redis-compatible in-memory databaseReal-time fraud features where in-memory speed must survive failureCosts more than ElastiCache; niche
Amazon DocumentDBMongoDB-API-compatible document databaseProduct catalogue, onboarding form data with flexible shapeCompatibility with MongoDB is partial ⚠ VERIFY your driver features
Amazon RedshiftColumnar data warehouse (provisioned or Serverless)Regulatory reporting, finance analytics over years of transactionsNot for OLTP. Concurrency and cost need tuning
Amazon S3 (+ Athena)Object storage. Athena queries files in place with SQLData lake of transaction history, statements archive, audit evidenceNot a database. Every query scans files, so partition them
Amazon NeptuneGraph databaseFraud rings, beneficial-ownership networksSpecialist skills; query languages Gremlin/openCypher/SPARQL
Amazon TimestreamTime-series databaseInfrastructure and market-tick metrics ⚠ VERIFY current Timestream offerings before building on itNot for money movements
Amazon KeyspacesCassandra-compatible wide-column storeLift-and-shift of existing Cassandra workloadsPick it only if you already run Cassandra

The later lessons cover each major store in depth. This lesson is about choosing.

The hard limitations to keep in mind

  • No store is "free" at scale. DynamoDB's on-demand pricing is per request: cheap at low volume, potentially expensive for a constant high load. RDS has a fixed hourly price: wasteful when idle, efficient when busy.
  • Licensing is architecture. RDS for SQL Server licence-included pricing is much higher than open-source engines. A SQL Server habit can cost more than the compute.
  • Data gravity is real. Once you have a few terabytes in one store, moving it is a project. Choose deliberately at the start.
  • Managed ≠ responsibility-free. AWS patches and backs up. You choose encryption keys, network exposure, users, retention, and whether you ever tested a restore.

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
SQL Server on a VMRDS for SQL Server, or SQL Server on EC2RDS manages backups, patching and HA, but restricts sysadmin and host access
Azure SQL DatabaseAurora PostgreSQL / RDS for PostgreSQLDifferent engine. T-SQL must be converted (or partially run via Babelfish)
Azure SQL HyperscaleAurora (shared distributed storage)Similar idea: storage separated from compute and replicated
Azure Cosmos DB (NoSQL API)DynamoDBDynamoDB has one data model (partition + sort key) and two consistency levels, not five
Azure Cosmos DB for MongoDBDocumentDBBoth are "MongoDB-compatible", with different gaps
Azure Cache for RedisElastiCache (Valkey/Redis OSS)Valkey is the open-source fork AWS now promotes
Azure Synapse dedicated SQL poolRedshiftBoth columnar MPP warehouses; Redshift Serverless is the pay-per-use option
ADLS Gen2 + Synapse serverless SQLS3 + AthenaSame "query files in place" model
Azure Table StorageDynamoDB (simplest use)DynamoDB adds transactions, streams and global tables

What carries over: normalisation, indexing, isolation levels, query plans, the habit of asking "what happens when this fails?". What is new: modelling for one store's access patterns, paying per request, and choosing between instance-based and serverless pricing.

Architecture

The way to think about it: one system of record per piece of data, with other stores holding derived copies for speed or analysis.

Security-boundary view. Every store sits in private subnets or behind IAM. Data that leaves the system of record (to caches, lakes or warehouses) takes its classification with it. If the ledger holds personal data under UK GDPR, so do its copies in S3 and Redshift. Each copy needs encryption with a KMS key, access control and a retention rule.

The decision framework

Ask these five questions, in this order, for every workload. Write the answers down: they become your ADR.

1. Access patterns: what questions, how often, how big?

List the reads and writes with rough numbers:

#Access patternFrequencyLatency needShape
A1Post a transaction to an account50/s peakunder 100 msSingle row insert + balance update
A2Get balance and last 50 transactions500/s peakunder 50 msOne account, ordered by time
A3Statement for one account and month20/sunder 1 sRange on date
A4All payments over £10k to new beneficiaries last quarterDaily, ad hocMinutes OKJoin + filter + group
A5Payment status by payment ID2,000/s peakunder 20 msKey lookup

Rules of thumb:

  • Mostly known, key-based lookups at high volume (A5) → key-value (DynamoDB).
  • Joins, ad-hoc questions, reporting on live data (A4) → relational, or a copy in the lake/warehouse.
  • Large scans over history → columnar (Redshift, Parquet + Athena), never the OLTP database at peak hours.

2. Consistency and integrity: what must never be wrong?

  • Must a write be visible to the next read immediately (read-your-writes)? Balances: yes. A marketing dashboard: no.
  • Do you need multi-row atomicity? Debiting one account and crediting another must both happen or neither. Relational databases do this naturally. DynamoDB does it with TransactWriteItems, which accepts up to 100 actions (4 MB in total) per transaction.
  • Do you need constraints (unique, foreign key, check) enforced by the store? Relational: yes, built in. DynamoDB: only via condition expressions you write.
  • Idempotency: can you enforce "this key is stored once"? Relational: a unique index. DynamoDB: a conditional PutItem with attribute_not_exists.

The transactions, isolation and consistency lesson goes deep on isolation levels.

3. Scale and growth: how big, how fast, how spiky?

  • Data size in 1 and 5 years. RDS for PostgreSQL scales storage to 64 TiB. Aurora cluster volumes grow automatically up to 128 TiB, or 256 TiB on specific engine versions. DynamoDB has no practical table size limit.
  • Write throughput. A single relational writer handles thousands of small transactions per second on a large instance. Beyond that you shard, or you move hot paths to DynamoDB.
  • Spikiness. Payday and Black Friday spikes favour serverless capacity (DynamoDB on-demand, Aurora Serverless v2) or headroom you pay for all month.

4. Operations and skills: who runs it at 3 a.m.?

  • Does the team know the engine? Harbourline's team knows SQL Server and EF Core. PostgreSQL is a short step; single-table DynamoDB design is a real learning curve.
  • Which HA/DR story do you need? Multi-AZ RDS, Aurora with readers, Aurora Global Database, DynamoDB global tables (see Multi-AZ, replicas, backups and PITR).
  • How will you back up, restore and prove it? Every store needs a restore drill.

5. Cost: what does it cost at idle, at average and at peak?

Pricing modelServicesGood when
Per instance-hourRDS, Aurora provisioned, ElastiCache nodes, DocumentDB, Redshift provisionedSteady, predictable load
Per capacity unit consumedAurora Serverless v2 (ACU-hours), Redshift Serverless (RPU-hours)Variable load, idle periods
Per request + storageDynamoDB on-demand, S3 + Athena (per TB scanned)Spiky or low volume
Provisioned throughputDynamoDB provisioned capacity (+ auto scaling)High, steady key-value load

Always add backup storage, data transfer, KMS keys, Secrets Manager secrets and licences to the estimate. The cost profile in the module overview lists the free alternatives for this course.

The decision flow

Two notes on this flow:

  • PostgreSQL JSONB is often a better answer than a separate document database. You keep one engine, one backup story and transactions across relational and JSON data.
  • "Must I use SQL Server?" is a separate question. It is about licensing and migration effort, covered in SQL Server ↔ AWS comparison.

Step-by-step implementation

This lesson's "implementation" is a decision. You will produce a short workload inventory, a scored option table and an ADR for one Harbourline workload.

Inventory the workload

Pick one workload, for example the payment status store behind the Payments Service. Write its access patterns as in the A1–A5 table: what is read and written, how often, how fast, and what it looks like. Note the data classification. Payment status records contain IBANs and amounts, so they are personal data.

Write the non-negotiables

List three to five requirements that disqualify an option outright. Examples:

  • "A duplicate payment must be impossible even with client retries."
  • "RPO no more than 5 minutes; RTO no more than 1 hour."
  • "Data stays in the UK or EU."
  • "No static database passwords."

Shortlist two or three options

Never shortlist one option: you can't show you chose anything. Usually that means a relational option, a key-value option and possibly "extend an existing store".

Score them against the five questions

Use a simple table. Write reasons, not just scores. The reasons are what reviewers check.

Record the decision as an ADR

Use the template in the Complete code section below. Store it next to the code (docs/adr-000N-*.md) so it is reviewed in pull requests. The module project's ADR lives at labs/m06-banking-data-store/docs/adr-0001-ledger-data-store.md and is a worked example.

Set a review trigger

Write down the event that would make you revisit the decision, for example "peak writes exceed 2,000/s" or "the business asks for active-active in two Regions". Decisions age; triggers keep them honest.

AWS Console instructions

No resources are created. To explore what is available in your Region, without cost:

  • Console → RDS → Create database: look at the engine options, then cancel. Note how the "Templates" choice (Production / Dev/Test / Free tier) changes Multi-AZ and instance class defaults.
  • Console → DynamoDB → Tables → Create table: note the two capacity modes (on-demand and provisioned), then cancel.
  • Console → Pricing Calculator (calculator.aws): estimate an RDS for PostgreSQL db.t4g.micro and a DynamoDB on-demand table with your access-pattern numbers. Compare the monthly totals at idle and at peak.

AWS CLI

These read-only commands help you see which engines and versions are offered. They cost nothing.

# Which PostgreSQL major versions can RDS create in us-east-1? (read-only, free)
aws rds describe-db-engine-versions --engine postgres \
  --query "DBEngineVersions[?Status=='available'].EngineVersion" \
  --output text --profile learn-sandbox --region us-east-1

# Which instance classes support RDS for PostgreSQL 17 here? Useful before you pick a size.
aws rds describe-orderable-db-instance-options --engine postgres --engine-version 17.6 \
  --query "OrderableDBInstanceOptions[].DBInstanceClass" --output text \
  --profile learn-sandbox --region us-east-1

# Is a DynamoDB table already present? (Empty list is the expected answer in a fresh sandbox.)
aws dynamodb list-tables --profile learn-sandbox --region us-east-1

If 17.6 is not listed in the first command's output, use a version that is. Minor versions change every few months ⚠ VERIFY the minor version before running the second command.

Infrastructure as Code

You don't deploy anything in this lesson. What belongs in source control is the decision, next to the infrastructure code that implements it. A practical convention:

docs/
  adr-0001-ledger-data-store.md       <- the "why"
infra/
  terraform/main.tf                   <- the "what" (links back to ADR-0001 in a comment)
# infra/terraform/main.tf
# Data store choice: see docs/adr-0001-ledger-data-store.md (RDS for PostgreSQL, not Aurora / DynamoDB).
# Review trigger: sustained writes > 2,000/s or a cross-Region active-active requirement.
resource "aws_db_instance" "ledger" {
  # ...defined in the module project, labs/m06-banking-data-store/infra/terraform
}
// In a CDK app, record the decision as stack metadata and tags, so it travels with the resources.
using Amazon.CDK;
using Constructs;

public sealed class LedgerStack : Stack
{
    public LedgerStack(Construct scope, string id, IStackProps? props = null) : base(scope, id, props)
    {
        // Visible in the CloudFormation template and in the console's stack metadata.
        TemplateOptions.Description = "Harbourline ledger data store - decision: docs/adr-0001-ledger-data-store.md";
        Amazon.CDK.Tags.Of(this).Add("DecisionRecord", "ADR-0001");
        // Database resources are added in the RDS lesson.
    }
}

Complete code

A decision needs evidence. This small, runnable C# console app turns your access-pattern estimates into a monthly cost comparison between a provisioned relational instance and DynamoDB on-demand. It runs locally, needs no AWS account and uses no NuGet packages.

The prices are inputs you must look up on the AWS pricing pages for your Region on the day you decide. Never hard-code them into a decision document without a date.

StoreCostSketch/Program.cs
using System.Globalization;

// Rough monthly cost sketch: relational instance vs DynamoDB on-demand, for ONE workload.
// Usage: dotnet run -- <writesPerSecAvg> <readsPerSecAvg> <itemKb> <storageGb>
// Example: dotnet run -- 20 200 1 50

var inv = CultureInfo.InvariantCulture;
var writesPerSec = args.Length > 0 ? double.Parse(args[0], inv) : 20;
var readsPerSec = args.Length > 1 ? double.Parse(args[1], inv) : 200;
var itemKb = args.Length > 2 ? double.Parse(args[2], inv) : 1;
var storageGb = args.Length > 3 ? double.Parse(args[3], inv) : 50;

// ---- PRICE INPUTS (USD, us-east-1). Look these up on the pricing pages and date them. ----
var p = new Prices(
    InstanceHourly: 0.016m,          // e.g. a small burstable RDS for PostgreSQL instance  ⚠ VERIFY
    RelationalStorageGbMonth: 0.115m, // gp3 storage per GB-month                            ⚠ VERIFY
    MultiAzFactor: 2m,               // Multi-AZ instance deployment roughly doubles instance + storage
    DdbWritePerMillion: 0.625m,      // on-demand write request units per million           ⚠ VERIFY
    DdbReadPerMillion: 0.125m,       // on-demand read request units per million            ⚠ VERIFY
    DdbStorageGbMonth: 0.25m);       // standard table class storage per GB-month           ⚠ VERIFY

const double SecondsPerMonth = 730 * 3600; // AWS pricing uses 730 hours per month

// DynamoDB: 1 write unit per 1 KB written; 1 read unit per 4 KB read (strongly consistent).
// Eventually consistent reads cost half. We assume strongly consistent reads for balances.
var writeUnits = writesPerSec * SecondsPerMonth * Math.Ceiling(itemKb / 1.0);
var readUnits = readsPerSec * SecondsPerMonth * Math.Ceiling(itemKb / 4.0);

var ddb = (decimal)(writeUnits / 1_000_000) * p.DdbWritePerMillion
        + (decimal)(readUnits / 1_000_000) * p.DdbReadPerMillion
        + (decimal)storageGb * p.DdbStorageGbMonth;

var rdsSingleAz = 730m * p.InstanceHourly + (decimal)storageGb * p.RelationalStorageGbMonth;
var rdsMultiAz = rdsSingleAz * p.MultiAzFactor;

Console.WriteLine($"Workload: {writesPerSec} writes/s, {readsPerSec} reads/s, {itemKb} KB items, {storageGb} GB");
Console.WriteLine($"DynamoDB on-demand     : {ddb,10:N2} USD/month");
Console.WriteLine($"RDS single-AZ          : {rdsSingleAz,10:N2} USD/month (instance must also be big enough!)");
Console.WriteLine($"RDS Multi-AZ           : {rdsMultiAz,10:N2} USD/month");
Console.WriteLine();
Console.WriteLine("Cost is one input. Re-read your access patterns and integrity needs before deciding.");

internal sealed record Prices(
    decimal InstanceHourly,
    decimal RelationalStorageGbMonth,
    decimal MultiAzFactor,
    decimal DdbWritePerMillion,
    decimal DdbReadPerMillion,
    decimal DdbStorageGbMonth);

Create and run it:

dotnet new console -n StoreCostSketch -f net10.0
# replace Program.cs with the code above
dotnet run --project StoreCostSketch -- 20 200 1 50

Here is the ADR template. Copy it into docs/adr-000N-<topic>.md:

docs/adr-template.md
# ADR-000N: <decision in a few words>

- Status: Proposed | Accepted | Superseded by ADR-000M
- Date: YYYY-MM-DD
- Deciders: <team, architect, data protection reviewer>
- Data classification: <e.g. personal data (UK GDPR), card data out of scope>

## Context
What workload, which access patterns (table with frequency/latency/shape), which non-negotiables.

## Options considered
| Option | Fit | Why chosen / not chosen |

## Decision
What we chose and the specific configuration that makes it correct (keys, constraints, encryption, HA).

## Consequences
Positive, negative, follow-ups. What this makes harder.

## Review trigger
The measurable event that reopens this decision.

## Compliance note
Technical controls only; retention/erasure/residency need compliance sign-off.

Code explained line by line

  1. var inv = CultureInfo.InvariantCulture;: parses 1.5 the same way on a UK or German Windows locale. Banking code should never depend on the machine's culture.
  2. The args lines read four numbers with sensible defaults, so dotnet run alone works.
  3. Prices is a record of inputs, each marked ⚠ VERIFY. The point of the tool is to make you look the prices up and date them. It is not a price list.
  4. MultiAzFactor: 2m: a Multi-AZ DB instance deployment runs a synchronous standby you pay for, so instance and storage roughly double. This is an estimate; check the pricing page.
  5. SecondsPerMonth = 730 * 3600: AWS prices monthly usage as 730 hours.
  6. writeUnits: DynamoDB charges one write request unit per 1 KB written, rounded up per item. A 1.2 KB item costs 2 units per write.
  7. readUnits: a strongly consistent read costs one read request unit per 4 KB. Eventually consistent reads cost half. Balances need strong reads, so the sketch assumes the more expensive option.
  8. ddb = ...: monthly DynamoDB cost is requests plus storage. There is no idle charge, which is why it wins for spiky or low-volume workloads.
  9. rdsSingleAz = 730m * p.InstanceHourly + ...: a relational instance bills every hour, busy or idle. The warning in the output matters: the instance must be large enough for peak load, and that sizing is not modelled here.
  10. The final line is the lesson in code: cost is one of five inputs.

Security considerations

  • Classification travels with data. Personal data copied to a cache, lake or warehouse is still personal data. Each copy needs encryption, access control and a retention rule, under UK GDPR's storage-limitation principle.
  • Fewer stores = smaller attack surface. Every new engine adds credentials, network paths, patching and monitoring. Prefer extending an existing store (for example PostgreSQL JSONB) when it fits.
  • Choose stores that support your security baseline: encryption with a customer managed KMS key, private networking (VPC or VPC endpoints), IAM-based access, audit logging. All the stores in the table support these, with different mechanisms. Check before committing.
  • Card data (PCI DSS): keep primary account numbers out of general-purpose stores entirely. Store tokens, and keep the card data environment as small as possible.

⚠ Learning shortcut — not for production

In this course, one person makes the data-store decision in an afternoon. In a bank, a data-store decision for a system of record goes through architecture review, a data protection impact assessment (DPIA) where personal data is involved, security review and often a risk committee. The ADR you write here is the input to that process, not a replacement for it.

Banking use case

Harbourline's architecture review applied the framework to five workloads. Fictional outcome:

WorkloadKey access patternsDecisionRejected and why
Core ledger (accounts, postings)Post with idempotency; balance; statement by date; ad-hoc audit SQLRDS for PostgreSQL, Multi-AZ; Aurora when RTO under 1 minute is requiredDynamoDB: ad-hoc audit queries and multi-row integrity are harder; SQL Server: licence cost
Payment statusGet by payment ID (2,000/s); update status; idempotency key checkDynamoDB on-demand with conditional writes, Streams to the audit trailRDS: needs headroom for spikes; the access pattern is pure key-value
FX rates and product reference dataRead-heavy, changes hourlyElastiCache Valkey cache-aside in front of PostgreSQLDynamoDB DAX: possible, but the source of truth is relational
Regulatory and finance reportingLarge scans and aggregations over 7 yearsS3 data lake (Parquet) + Athena, Redshift for interactive BIQuerying the ledger at month-end: slows down posting
Onboarding form draftsSave and resume a semi-structured formPostgreSQL JSONB column in the onboarding schemaDocumentDB: a second engine for one table is not worth the operational cost

Notice that the ledger did not move to NoSQL and payment status did not stay in the ledger. The reasons are written down, so the next architect can challenge them.

Common mistakes

  • Choosing by fashion or by CV. "DynamoDB is modern" is not an access pattern. Write the access patterns down first.
  • Assuming NoSQL means "no schema". DynamoDB has a strict schema for keys and an implicit one for everything else. Changing your access patterns later can mean rewriting the table.
  • Using the OLTP database for analytics. Month-end reports on the primary instance slow down postings. Use a read replica, an export or the lake.
  • Forgetting idle cost. A provisioned instance for a workload that runs one hour a day wastes 23 hours of spend. Look at serverless options.
  • Ignoring licence cost. RDS for SQL Server Enterprise licence-included pricing is a big step up. Compare it with PostgreSQL before defaulting to the familiar engine.
  • No review trigger. Decisions made for 50 writes/s quietly become wrong at 5,000 writes/s.

Troubleshooting

SymptomLikely causeFix
A "simple" report takes hoursOLTP store used for analytics, or DynamoDB scanMove analytics to S3/Athena or Redshift; use replicas or exports
DynamoDB bill much higher than expectedScans, large items, strongly consistent reads, or hot on-demand trafficCheck access patterns; use queries not scans; consider provisioned capacity
Database CPU pinned at month-endBatch and online workloads share one instanceSeparate the workloads; schedule batch on a replica or the lake
Can't answer an auditor's question quicklyStore chosen for a single access patternStream changes to S3; keep an analytics copy
Two teams store the "same" customer differentlyNo agreed system of recordName one system of record per entity in the architecture docs

Cost and cleanup

This lesson creates no resources and costs nothing. The CLI commands are read-only and free. If you opened a Create database or Create table page in the console, make sure you chose Cancel, then check:

# Expect no instances and no tables in a fresh sandbox
aws rds describe-db-instances --query "DBInstances[].DBInstanceIdentifier" --profile learn-sandbox --region us-east-1
aws dynamodb list-tables --profile learn-sandbox --region us-east-1

Exercises

  • 🟢 Guided: For the payment status workload, fill in an access-pattern table (at least five patterns with frequency, latency and shape) and run StoreCostSketch with your numbers for both average and peak load.
  • 🟡 Challenge: Write a full ADR for customer notification preferences (email/SMS/push opt-ins, read on every notification, updated rarely, must be auditable for consent under UK GDPR). Shortlist at least three options.
  • 🔴 Live problem: A ticket arrives: "The fraud team wants to query 'all customers who share a device, phone number or beneficiary with a known mule account, up to 3 hops'. The ledger team says that's impossible in PostgreSQL. Please advise by Friday." Decide what you would recommend, what you would prototype first, and what you would refuse to do.

Assignment

Add docs/adr-0001-<workload>.md to your portfolio repository for a workload of your choice (Harbourline or your own fictional bank). It must include an access-pattern table, at least three options with reasons, the decision, consequences, a review trigger and the compliance note. Link it from your repository README.

Solutions

Knowledge check

Interview questions

  • "How do you decide between RDS and DynamoDB?" Start from access patterns and integrity needs, not scale. If the questions are ad hoc, relational and need multi-row constraints, choose RDS or Aurora. If they are known key lookups at high or spiky volume, with integrity expressible as conditional writes, choose DynamoDB. Then check operations, skills and cost at idle and at peak.
  • "Your team wants a new database engine for one service. What do you ask?" What access pattern can't the existing stores serve? Who will operate it at 3 a.m.? How will it be backed up and restored, and how will we prove that? What does it cost at idle? How does it meet our encryption, network and audit baseline?
  • "Where does reporting run in your design?" Not on the OLTP primary at peak. Use a read replica for light operational reports, and the lake (S3 + Athena) or a warehouse (Redshift) for heavy and historical analysis, fed by change data capture or exports.
  • "What goes in an ADR?" Context and access patterns, options with reasons, the decision and its key configuration, consequences, a review trigger, and a compliance note.

Certification practice

Completion checklist

  • I can describe each AWS database service in one sentence and name a banking use for it
  • I can explain the five decision questions and their order
  • I completed an access-pattern table and ran the cost sketch
  • I wrote an ADR with at least three options and a review trigger
  • I confirmed no RDS instances or DynamoDB tables were created

Key takeaways

  • Access patterns first, store second. Write the questions down with frequency, latency and shape.
  • Relational stores buy query flexibility and integrity; key-value stores buy predictable speed at scale for known questions; warehouses and lakes buy cheap analysis of history.
  • Keep one system of record per entity; caches, lakes and warehouses hold derived copies that inherit the data's classification.
  • Cost has two shapes, per hour and per request. Compare them at idle, average and peak, and include licences, backups and keys.
  • Record every decision in an ADR with a review trigger, stored next to the code.

Further reading

Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page