← AWS Solutions Architect Associate: architecture decisions
06 / 25 · 70 MIN

Databases, replicas, and cache

Choose reads and capacity with explicit consistency, protecting the origin when cache fails.

Choose the read path

At a fictional funds close, reporting delays application confirmations. First draw writers, readers, and freshness requirements. The standby in an RDS Multi-AZ DB instance deployment does not accept application SELECTs.

A Multi-AZ DB cluster is a different deployment with readers that can serve queries. Asynchronous read replicas can offload reports that tolerate lag; confirmation that must observe a completed write needs a path compatible with that consistency.

In Aurora, the reader endpoint distributes connections, not every query within a session. Inspect the pool before concluding that two replicas mean half the queries on each. Record deployment type, endpoint, tolerated lag, and acceptance evidence in the proposal.

Size resources and plan promotion

Daily average CPU can hide insufficient memory, saturated I/O, or accumulating connections at month-end. Collect these dimensions during the critical window and compare candidate class limits before reducing capacity. Storage autoscaling addresses allocated space; it is not a command to increase CPU.

Set headroom and a maximum before a large load, and do not assume deleting data later reduces allocation. When promoting an RDS read replica to a standalone instance, plan the transition: previous replication stops feeding that instance. Do not expect automatic return to the former relationship.

In the exercise, deliver cutover criteria, data validation, and an alternative if promotion does not satisfy the requirement.

Query DynamoDB without hiding work

Start with access patterns. Using only the date as partition key can concentrate today’s writes; distributing keys also requires query and aggregation design. In a Query, the key condition selects what to read; the filter removes results afterwards.

Do not move partition-key or sort-key attributes into FilterExpression. A page without Items can still contain LastEvaluatedKey: continue with that value as ExclusiveStartKey while keeping the key condition. The token does not promise more matching results; pagination still needs completion.

For Scan, compare ScannedCount and Count per page. Returning few items does not demonstrate that the read consumed few resources. Record consumed capacity and processed pages.

Include indexes and protect traffic

A GSI query returns only attributes available in its projection; it does not automatically perform an additional table read for the rest. Plan that explicit read or a different projection, considering cost, latency, and consistency. A GSI with insufficient write capacity can apply back pressure and affect table writes even when overall table capacity appears free.

Check the resource identified by the error before increasing only the table. For inventory scanning data used by the application, multiplying workers can rapidly consume shared capacity. Control rate, concurrency, and execution window; also measure business-traffic latency.

The administrative task is properly sized only if it respects those limits.

Define cache freshness

With lazy loading, a miss leads to the origin and cache population. TTL limits residence since insertion; it does not immediately expose a later database change. Draw the exercise sequence: a reader obtains v1, a writer commits v2 and invalidates, then the delayed reader inserts v1 again.

One invalidation does not resolve that race. The local model uses an already-known authoritative version to reject old fills; this is an illustrative rule, not an automatic ElastiCache feature. Real application coordination must address concurrency and failures.

A negative entry also needs refreshing: a missing result can become incorrect when the object is created. Document tolerance by data type and the read path required to confirm a write.

Rehearse an empty cache and hand over to RUN

With independent local caches, invalidating only worker A can leave B returning old data. A shared cache reduces this problem but still needs an update protocol. When the cache fails or starts empty, bound origin calls and assess combining simultaneous requests for the same key. Define permitted rejection or degradation rather than assuming unlimited database capacity. If a database write was already confirmed and only the cache update failed, do not blindly repeat an operation with effects: look up the result using its stable identifier and repair the read path. Reserve twenty minutes for the model and a matrix covering warm, empty, unavailable, and delayed-read conditions. Record predictions separately from executed rehearsals; cases are fictional and do not describe processes of financial institutions.

Matrix inputs: 1000 independent reads arrive in a synthetic one-second window. Each miss requires exactly one database query; there are no retries, request coalescing, or other load. The origin budget is 300 queries in that window. A warm cache has 900 hits; an empty or unavailable cache has zero. Predict required queries, admitted queries, and reads needing rejection or degradation. Worked resolution: warm requires and admits 100, leaving zero unserved; empty or unavailable requires 1000, admits 300, and leaves 700 unserved. The code uses deterministic counts without measuring AWS throughput or latency. Run it with Node.js, change the budget to 80, and explain the new outcomes: 20 unserved reads for warm cache and 920 for each other case. Delayed filling is a separate dimension: the known-version guard rejects v1, but this model implements neither distributed version discovery nor a cache protocol.

// Synthetic in-memory teaching model; no AWS, database, or cache calls.
const pages = [{Items: [], LastEvaluatedKey: {pk: 'cursor'}}, {Items: [{id: 'match'}]}];
const collected = [];
let requests = 0;
for (const page of pages) {
  requests++;
  collected.push(...page.Items);
  if (!page.LastEvaluatedKey) break;
}
const authoritativeVersion = 2;
let cached = null;
const delayedRead = {version: 1, value: 'old'};
cached = delayedRead; // An unguarded late fill reintroduces stale data.
const naiveVersion = cached.version;
cached = null;
if (delayedRead.version === authoritativeVersion) cached = delayedRead;
const originBudget = 300; // Per synthetic one-second window, not an AWS limit.
const cacheCases = [
  {state: 'warm', reads: 1000, hits: 900},
  {state: 'empty', reads: 1000, hits: 0},
  {state: 'unavailable', reads: 1000, hits: 0},
];
const originCases = cacheCases.map(({state, reads, hits}) => {
  const required = reads - hits;
  const admitted = Math.min(required, originBudget);
  return {state, required, admitted, unserved: required - admitted};
});
console.log(JSON.stringify({requests, returned: collected.length, naiveVersion, guardedFill: cached, originCases}));
IN PRACTICE

A Query returns empty Items and LastEvaluatedKey. The client continues; stopping on that page would lose the next page’s result in the example.

Common pitfalls

Confusing standby with reader; assuming per-query balancing; stopping on an empty page; ignoring GSIs; treating TTL as immediate consistency.

Related topics: Relational databases, connections, and recovery · DynamoDB: consistency, capacity, and concurrency · Costs, commitments, and retirement

Take this idea with you

Define read semantics and observe the limiting resource before adding replicas, cache, or capacity.

Create account

References

AWS is a trademark of Amazon.com, Inc. or its affiliates. bigsavant.com is an independent preparation platform and is not affiliated with, associated with, sponsored, authorised or endorsed by AWS. Content and questions are original, are not official exam questions, and completing our tests does not award or guarantee any certification. Names are used only to identify the subject. All other trademarks belong to their respective owners.