Choose a database from its busiest queries
Distinguish read pressure, write contention, connection storms and unsuitable data models.
Task 3.3 · Choose a database from its busiest queries
Model the request before choosing the engine
List keys, joins, transaction boundaries, read-after-write needs and the worst hot key. Aurora and RDS engines support relational workloads. Preserve required extensions or stored procedures when choosing PostgreSQL or MySQL compatibility. DynamoDB suits predictable item or range access with a well-distributed partition key. Add secondary indexes for defined alternative queries. Graph traversals can fit Neptune. Analytical scans often belong in Redshift or an S3 analytics path. A migration across engines requires schema and query compatibility testing in addition to moving data.
Decide which reader needs freshness
A read replica can offload reports but may lag behind a committed write. Route freshness-sensitive reads to the writer or a consistency mechanism the database supports. ElastiCache can absorb repeated reads: identify cache keys, expiry and invalidation, and plan for cold-start load. A read-through or cache-aside path must tolerate cache loss. DAX can accelerate suitable DynamoDB eventually consistent reads. A cache cannot distribute writes tied to a single hot partition key.
Distinguish a slow query from a full pool
Inspect top SQL, plans, indexes, locks, connection counts, I/O latency and replica lag. Short-lived functions can exhaust connections even with low CPU. RDS Proxy multiplexes eligible connections and limits database churn. For a storage bottleneck consider provisioned IOPS and instance limits. For a key-value service, measure throttling by key distribution and capacity mode before adding aggregate capacity.
Plan for connections that stay open
An Aurora reader endpoint distributes connection requests across eligible readers. A long-lived SQL connection keeps using its chosen instance. Inspect the pool's connection distribution before adding readers to fix a single busy host. Benchmark a representative query plan as the dataset grows and compare scanned rows, index selectivity and I/O wait. An additional replica can relieve concurrent reads while leaving a single inefficient query slow.
A checkout sometimes forgets an order
The writer commits each order successfully. The confirmation page immediately reads an asynchronous replica. A daily product report performs large joins and can be ten minutes stale. The connection graph shows healthy headroom.
Which reads should use the writer, and where should the report run?
Compare your design with the worked answer
Read the just-created order on the writer for its confirmation. Send permissible reporting reads to a replica and watch lag against the ten-minute budget. Verify success under concurrent checkouts. Buying a larger connection pool will not repair a stale read.
If reporting scans begin driving replica lag above the target, isolate analytical work further, for example by loading a reporting warehouse. Recheck the time to make the new data available.
Apply the video example
Draw the Aurora writer and reader instances discussed in the video. Label an order insert, immediate receipt lookup and nightly report. Route the first two through a path that satisfies read-after-write and allow the report to use a reader only if its lag meets the reporting agreement.
freeCodeCamp at 43:01:47 · Aurora endpoint behavior
AWS exam guide for this domain · Return to the objective map
Choose a database from its busiest queries quiz
Answer 5 questions. Check each answer for an explanation.