AWS-DB-Study
One-sentence rule: every answer — state the pick, the first data you would pull, and the trap you ruled out, in that order.
Role essence: customer-facing technical enablement — lead strategic enterprise customers through migration + query-performance problems onto distributed multi-region DSQL, define adoption best practices, channel field feedback into product direction.
Today's drill
15-day index
Listen while you move
12 episodes (E1–E12). Tap Read aloud to use your phone's voice, or open the script. After each episode, pause and say the key line out loud. Voiced MP3s land with the media build; the player appears automatically when its file exists.
Scenario drill (timer on, narrate aloud)
Pick a scenario. Understand → Prepare → Identify → Support. Mitigate first when the customer is down. Name the metric.
Worked examples (read cold, predict, then check)
1 · DSQL write conflict at commit
Two regions update the same product row within one second. Under snapshot isolation with optimistic concurrency, what does each transaction observe, which one wins, and what must the loser do? Where does the retry belong — client, driver, or middleware?
Answer: each sees its own snapshot; first committer wins at adjudication; loser gets a conflict error and retries the whole transaction (idempotent retry with backoff+jitter). Retry belongs in the app's transaction wrapper, not the driver — only the app knows the unit of work. Trap: retrying blindly on non-idempotent writes.
2 · Connection math before bigger instance
200 app pods, pool size 25 each, DSQL cap 10k connections. Is the database the problem? Show the math and the fix order.
Answer: 200 × 25 = 5,000 — under the cap, so look at top-SQL/wait events first, not tier size. Fix order: pool right-size → transaction scope/timeouts → top-query EXPLAIN → only then capacity. Trap: scaling the tier for a pooling bug.
3 · Oracle→DSQL migration triage
SCT flags 40 PL/SQL packages, sequences, and dblinks. Rank what blocks cutover vs what can go post-launch, and name the replication shape for the transition window.
Answer: blockers = correctness items (sequences→identity semantics, dblinks→app-side joins, unsupported types). Post-launch = perf tuning of converted procedures. Transition = DMS full load + ongoing CDC with validation, cutover with rollback snapshot. Trap: declaring victory at 100% SCT conversion without a CDC-tested rollback.
Aloud scripts (E1–E12 texts + daily reps)
- E1 — DSQL architecture
- E2 — S3 durability + 403 triage
- E3 — RDS + Aurora HA
- E4 — DSQL limits + Limitless
- E5 — DynamoDB Global Tables
- E6 — Cache, DocumentDB, Neptune
- E7 — VPC + connectivity
- E8 — PG performance tuning
- E9 — Distributed theory
- E10 — Scenario reps
- E11 — Behavioral + Leadership Principles
- E12 — Repetition stack
Daily say-aloud reps
- "Understand. Prepare. Identify. Support. Data first, trap ruled out, fix that stays fixed."
- "Two active Regions plus witness gives quorum without losing writes — RPO zero, RTO minutes."
- "Conflicts are adjudicated at commit; the loser retries the whole transaction."
- "Same 403 to the client — explicit Deny, IAM, bucket policy, KMS key policy, or SCP. I check in that order."
- "In Oracle I did X with [tool]; in AWS I get the same outcome with [service], and the difference I watch for is [trap]."
Code drills (narrate before you touch code)
Drill 1 · Slow-query triage from EXPLAIN
Given EXPLAIN (ANALYZE, BUFFERS) showing Seq Scan on 40M rows, Buffers shared hit=12 read=380k, and a nested loop over it — narrate: top line first, the one fix with biggest payoff, and what you re-measure.
Bug → risk → fix → test. Fix: composite index on the filter+join columns (equality first, range last). Re-measure: execution time + buffers hit ratio for that query hash in Performance Insights.
Drill 2 · Buggy retry client
for row in orders:
try: db.exec("UPDATE stock SET qty = qty - 1 WHERE id=%s", row)
except: pass # retry later
Name every bug, its production risk, the fix, and one test case each — before editing.
Bugs: swallowed exceptions (silent data loss) · no idempotency key (double-decrement on retry) · no transaction boundary · no backoff/jitter (retry storm) · no timeout. On DSQL add: whole-transaction retry on conflict error, not per-statement.
Drill 3 · Pool sizing math
Service runs 60 tasks × pool 20 against RDS max_connections 400. p95 spikes at deploy. Compute headroom, state the fix, and the CloudWatch metric that proves it.
60 × 20 = 1,200 demand vs 400 cap — 3× over. Fix: centralize pooling (RDS Proxy) or cut per-task pool to ≤5 with queueing. Prove with DatabaseConnections + p95 latency back inside SLO for a full traffic cycle.
DB practice (say the query plan before the answer)
- Top-SQL read: open Performance Insights, top SQL by total time — state wait event, then EXPLAIN the leader. Do this for 3 queries without notes.
- Index design: given filter + join + order columns, write the composite index left-to-right and defend each position in one sentence.
- Hotspot call: given a partition/CPU skew chart, name the leading key field and the redesign (UUID, hash prefix, bit-reversed sequence) in 30 seconds.
- 403 drill: recite the S3 403 order — explicit Deny → IAM allow → bucket policy → KMS key policy → SCP/conditions — with one fix per layer.
- Translation speed round: RAC → ? · Data Guard → ? · GoldenGate → ? · RMAN → ? · AWR/ASH → ? — answer each in under 5 seconds with the trap.
Cheat sheet (condensed — full text in repo)
Method
Understand → Prepare → Identify → Support. Data first, trap ruled out, fix that stays fixed. Say the LP it maps to.
DSQL hard caps (memorize)
20 single-Region / 5 multi-Region clusters · 10 TiB default (256 TiB max) · 10k conns · 10 MiB txn · 3000 rows/txn · 1 MiB col · 2 MiB row · 8 index cols · 24 indexes/table · 10 schemas.
First data to pull
- DSQL/RDS/Aurora:
pg_stat_activity+ Performance Insights top-SQL +EXPLAIN (ANALYZE, BUFFERS) - OS attribution: Enhanced Monitoring + CloudWatch DatabaseConnections, ReplicaLag, FreeableMemory
- DynamoDB: ThrottledRequests + contributor insights for hot keys
- S3 403: Deny → IAM → bucket policy → KMS → SCP/conditions
Translations
RAC → Aurora Multi-AZ/Limitless/DSQL · Data Guard → Global DB/Multi-AZ standby · GoldenGate → DMS CDC · RMAN → snapshots+PITR · AWR/ASH → PI+EM+CloudWatch.
Mock loop (Day 15 — narrate as if the interviewer is the customer)
- Round 1 · Migration whiteboard (20 min): Oracle→DSQL for a strategic customer — SCT assessment → compat-gap triage → DMS full+CDC → cutover + rollback. Close with one publishable best practice + one Eng feedback item.
- Round 2 · Slow-query triage (15 min): PI top-SQL → EXPLAIN → index fix → re-measure. Say the metric.
- Round 3 · LP behavioral (15 min): any 2 stories from the STAR bank with real metrics. "I", not "we".
- Round 4 · Bar Raiser depth (10 min): pick your weakest answer and defend it three levels deeper than comfortable.
Gap narrative (say calm): "My gap is hands-on serverless-AWS depth versus Oracle internals — closing it with labs, and where I'd need the service team I'll say so."