Database access patterns, types, and capacity models
Design database architecture from access patterns, transaction and consistency needs, key distribution, capacity variability, and geographic latency before selecting relational, key-value, serverless, or global modes.
LESSON GOALS
By the end, you can
- Explain and apply how to select data model and capacity from access, consistency, transactions, and scale.
- Compare relational/non-relational, serverless/provisioned, and regional/global under explicit security, resilience, performance, operations, and cost constraints.
01
Model operations before selecting a database
Write the important operations as concrete questions: get an order by ID, list a customer’s recent orders in time order, atomically update inventory and payment state, or read a session by token. Record read/write ratio, consistency, transaction scope, item size, range and join needs, expected rate, growth, tenant skew, and Regional latency. A service name cannot rescue an access model it does not support efficiently.
Relational databases fit SQL constraints, joins, and multi-row transaction requirements. RDS offers managed relational engines; Aurora provides MySQL- or PostgreSQL-compatible relational behavior with distributed cluster storage and reader options. DynamoDB fits key-value/document access designed around partition and sort keys. Its table design begins with known queries; scans and one hot tenant are not solved merely by changing capacity mode. Purpose-built graph, search, time-series, and warehouse services become candidates only when that data model is the hard requirement.
02
Connect capacity model to traffic shape
Relational capacity is shaped by instance CPU, memory, connections, storage IOPS and throughput, writer contention, and replica reads. Serverless modes still expose capacity ranges and scaling behavior; serverless means managed elasticity, not absence of limits. DynamoDB offers provisioned and on-demand capacity. Provisioned fits predictable traffic and explicit planning; on-demand reduces planning for variable demand, but partition-key distribution and sudden growth behavior still matter.
For DynamoDB, distribute high-cardinality partition keys and design sort keys or indexes for each required query. Strongly consistent reads are available only on documented resources; global secondary indexes are eventually consistent. For relational systems, choose an engine from application compatibility, SQL features, extensions, licensing, operations, and migration path—not from a generic claim that one engine is faster. Capacity planning uses measured operations, consistency, item size, and peak rate with headroom.
03
Place data for latency and resilience without mixing goals
Availability Zones and Regions shape latency and failure scope. A Regional database close to compute usually minimizes application latency. Multi-AZ deployment addresses AZ failure according to the exact database mode; it does not automatically satisfy global latency. Multi-Region replication can improve local reads or writes but adds lag, consistency, conflict, routing, quota, and failback decisions. Select it only when the business requirement justifies those costs.
Architect a portfolio rather than one universal database: an order ledger may remain relational while ephemeral sessions use DynamoDB. Keep security boundaries, encryption, backup, observability, and access controls explicit. Compare total operations and cost only after data model and correctness pass. A low-cost key-value store loses when ad hoc joins are mandatory; a relational cluster loses when a simple high-scale key lookup with predictable access has no relational need. State the decisive model and two rejected models in every design.
In-memory is a database type decision only after durability and reconstruction are explicit. ElastiCache keeps data in memory for low-latency access and can act as a cache or data store, but eviction, node events, and the selected engine or topology define what loss means. It fits a rebuildable leaderboard, session acceleration, counters, or repeatedly read objects when the application has a safe miss and recovery path. It loses as the only order ledger when a missing key would erase an authoritative transaction. Contrast that with DynamoDB, whose key-value persistence and capacity model fit durable known-key records, and with a relational engine, whose joins and constraints fit the order state. Make the branch observable by terminating a cache node or flushing a test key: rebuildable data should repopulate within its latency objective, while authoritative writes must remain intact elsewhere. Protect tenant-specific keys from cross-tenant reuse, restrict network and data-plane access, and never place secrets in an unprotected cache value. Price the memory working set and replicas against avoided database work; an in-memory tier with low hit rate and expensive invalidation is a cost increase, not a performance architecture.
DECISION TABLE
Compare the architecture constraints
| requirement | choose | because | reject |
|---|---|---|---|
| Joins, constraints, and multi-row transactions | RDS or Aurora relational engine | Relational semantics are mandatory | DynamoDB would require access-model redesign |
| Predictable key lookup at variable massive scale | DynamoDB on-demand with well-distributed key | Key-value access and variable capacity fit | Relational joins are unnecessary overhead |
| Known steady key-value throughput | DynamoDB provisioned capacity | Capacity can be planned and observed | On-demand may trade control/economics without a variability need |
| MySQL/PostgreSQL-compatible relational plus readers | Aurora | Compatibility and cluster reader model fit | A nonrelational store violates SQL requirements |
GUIDED WORKED SCENARIO
Reason from the stated constraints
This is a guided example, not a question to memorise. The knowledge check uses new situations to test the same reasoning.
A commerce platform needs an order ledger with joins and atomic status updates, user sessions read by token at 40,000 requests/s, and low-latency catalog reads in two Regions.
Requirements
- Preserve relational order constraints
- Scale session point lookups unpredictably
- Keep sessions disposable after 24 hours
- State consistency and write ownership for global catalog data
- Serve rebuildable recommendation scores from an in-memory type
Reasoning path
- Separate workloads by access model.
- Use Aurora/RDS for orders because relational transactions decide.
- Use DynamoDB with distributed session token key and TTL for sessions.
- Choose catalog replication only after defining stale tolerance and write Region.
- Use ElastiCache only for rebuildable low-latency scores with a tested miss and node-loss path.
Why it wins
- Each store matches its access and consistency contract.
- Capacity and placement are planned per workload rather than hidden behind one database.
- The in-memory branch meets latency while loss remains recoverable from durable data.
Why the alternatives lose
Order joins and transaction semantics require a major redesign not justified by the requirements.
Becomes correct when: All access patterns are known key/document operations with compatible transaction scope.It centralizes unrelated session scale and creates a vertical bottleneck.
Becomes correct when: Scale is modest, relational queries are needed for every dataset, and operations favor one engine.Cache eviction or loss would become data loss if sessions are authoritative.
Becomes correct when: Sessions are safely reconstructable and cache loss is explicitly acceptable.ARCHITECTURE VISUAL · TEXT MODE
Inspect the model
A service-choice matrix maps each order, session, catalog, and rebuildable score operation to consistency, durability, key shape, loss test, and database type.
saa-viz-service-choice-labKNOWLEDGE CHECK
Answer one question at a time
Pass every question to complete this lesson. Each answer includes reasoning before you continue.
What should be written before a DynamoDB key schema?
Reveal reasoning
Every required access pattern, consistency need, item size, and peak rate.
Why is multi-Region not automatically higher-performing?
Reveal reasoning
Replication, routing, consistency, and write ownership can add latency and complexity.
Change one decisive constraint: Every operation is a known key or document access with no relational joins and a transaction scope supported by DynamoDB. Which architecture now wins, and what observable result proves the reversal?
Reveal reasoning
The persistence winner reverses to a DynamoDB-centered single-table design. The proof is: A trace of every required query resolves by designed keys without scans or cross-item relational joins.
Before reveal in saa-viz-service-choice-lab, predict the first failed gate for the original database access patterns, types, and capacity models case, then trace the observed branch and minimal repair.
Reveal reasoning
Commits to an outcome first, follows the visual gate order, separates routing or control state from business response, and repairs the earliest violated requirement.
PRIMARY SOURCES
Verify the claims
- primaryWhat is Amazon RDS?aws-db-rds · retrieved 2026-07-29
- primaryWhat is Amazon Aurora?aws-db-aurora · retrieved 2026-07-29
- primaryWhat is Amazon DynamoDB?aws-db-dynamodb · retrieved 2026-07-29
- primaryBest practices for designing and using partition keys effectively in DynamoDBaws-dynamodb-partition-key-design · retrieved 2026-07-30
- primaryDynamoDB read consistencyaws-dynamodb-read-consistency · retrieved 2026-07-30
- primaryDynamoDB on-demand capacity modeaws-dynamodb-on-demand-capacity · retrieved 2026-07-30
- primaryWhat is Amazon ElastiCache?aws-db-elasticache · retrieved 2026-07-29