# CHEAT_SHEET — Principal DB Engineer, Distributed SQL

## 1. Troubleshooting method (Understand–Prepare–Identify–Support)

1. **Understand** — symptom, scope, recency: what changed, who is affected, since when. Pull the first data (see §3) before theorizing.
2. **Prepare** — baseline + blast radius: metrics window, recent deploys/config, guard against making it worse (snapshot, read-only check).
3. **Identify** — narrow with evidence: top wait event / top SQL / error class; form one hypothesis, test it, rule out the trap (§2).
4. **Support** — fix + stay-fixed: remediate, verify metric recovery, write the runbook/automation so the defect class cannot recur. Say the LP it maps to.

Say aloud: "Understand, Prepare, Identify, Support — data first, trap ruled out, fix that stays fixed."

## 2. Decision matrix — Need / Pick / Why + Trap

| Need | Pick | Why + Trap |
|------|------|------------|
| Object/blob/file store | S3 + lifecycle/versioning/replication | Durable lake; lifecycle cuts cost. TRAP: replication needs versioning on both buckets; lifecycle skips PENDING/FAILED replicas |
| Managed relational OLTP | RDS (PG/MySQL) Multi-AZ + replicas | Multi-AZ = HA/failover; replicas = read scale (async). TRAP: standby serves no reads; replicas can lag |
| Global reads + cross-region DR, single writer OK | Aurora Global DB (1 write + ≤10 read regions) | Storage-layer replication, <1s lag. TRAP: single writer — not multi-active like DSQL |
| Serverless multi-region active-active SQL | Aurora DSQL | PG-compatible, snapshot isolation, optimistic concurrency, 2-active + witness quorum. TRAP: caps — 10 MiB txn, 3000 rows/txn, 10k conns, 10 TiB default (256 TiB max), 24 indexes/table, 10 schemas; PG-compat gaps |
| Horizontal PG write scale | Aurora Limitless | Sharded tables via router + shard groups, ACU-based. TRAP: Limitless-only 16.X engine, I/O-Optimized only, backup-retention limits; standard-vs-sharded design matters |
| Internet-scale KV, multi-active, <10ms | DynamoDB Global Tables | Serverless, 99.999%, global replication. TRAP: needs PK design + DAX-staleness handling (see below) |
| Microsecond cacheable reads | ElastiCache Valkey/Redis Serverless + DAX (for DynamoDB) | Cache-aside for sessions/leaderboards. TRAP: ephemeral — design miss path; DAX bypass on global-table writes stale till TTL; DAX = cost/complexity, skip for write-heavy paths |
| Mongo-compat JSON docs | DocumentDB | Familiar API on managed infra. TRAP: compat not 100% — verify APIs/indexes |
| Cassandra-compat wide column | Keyspaces (for Apache Cassandra) | Serverless wide-column. TRAP: verify CQL-compat deltas |
| Highly-connected graph | Neptune (Gremlin/openCypher/SPARQL) | Purpose-built graph. TRAP: writer + ≤15 read replicas, instance-based — not serverless autoscale |
| Curated warehouse, concurrency | Redshift (+ Spectrum, zero-ETL target) | Provisioned/serverless warehouse. TRAP: overkill for sporadic queries; zero-ETL supports subset of types/regions |
| Ad-hoc SQL on the lake | Athena on S3/Glue/Iceberg | Serverless, pay per scan. TRAP: unpartitioned scans explode cost |
| Heterogeneous migration / ongoing sync | DMS full + CDC (+ SCT assessment) | Logical replication across engines. TRAP: needs PKs/indexes + source logging; drifts on DDL/LOBs |

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.

## 3. First data to pull (commands)

- DSQL/RDS/Aurora: `SELECT * FROM pg_stat_activity;` + Performance Insights top-SQL / DB-load-by-wait + `EXPLAIN (ANALYZE, BUFFERS) <q>;`
- OS attribution: Enhanced Monitoring (1s CPU/mem/IO) + CloudWatch `DatabaseConnections`, `ReplicaLag`, `FreeableMemory`.
- Limitless: PI shard-level analysis (`USER_PerfInsights.AnalyzeLimitlessTables` runbook).
- DynamoDB: CloudWatch `ThrottledRequests`, `Read/WriteThrottleEvents`, contributor insights for hot keys.
- S3 403: check order — explicit Deny → IAM allow → bucket policy → KMS key policy → SCP/conditions (Block Public Access, Object Ownership, encryption context).
- Network: SG rules (app SG → db SG:port), route tables, NACLs, endpoint status (gateway for S3/DynamoDB, interface/RDS Proxy for DB).

## 4. Oracle → AWS translations

| Oracle | AWS | Note |
|--------|-----|------|
| RAC | Aurora Multi-AZ / Limitless / DSQL | HA by architecture, not clusterware |
| Data Guard / Active DG | Aurora Global DB / RDS Multi-AZ standby / EC2 self-managed DG | Managed = no OS-level DG installs |
| GoldenGate | DMS CDC / heterogeneous replication | Logical; needs keys + logging |
| RMAN | Automated snapshots + PITR + S3 export | Point-in-time by backup window |
| AWR / ASH | Performance Insights + Enhanced Monitoring + CloudWatch | Wait-event + top-SQL + OS metrics |
| Partitioning by ROWID habit | DynamoDB PK/SK design; Limitless shard key; Redshift dist/sort keys | Design the access pattern first |

Say-aloud bridge: "In Oracle I did X with [tool]; in AWS I do the same outcome with [service], and the difference I watch for is [trap]."

## 5. STAR story index (Situation 2–3 sent / Task "I owned" / Action longest / Result X-as-measured-by-Y-by-doing-Z + stay-fixed)

| LP | Story | Metric to quote |
|----|-------|-----------------|
| Ownership | ADB outage / perf escalation | MTTR + runbook cut next MTTR |
| Dive Deep | Diagnostics tool / product fix others missed | Lookup 30→5 min (or equivalent) via root-cause data |
| Bias for Action | Workaround in 24h, fix next cycle | Time-to-mitigate + ship date |
| Customer Obsession | Angry-customer turnaround | CSAT / kudos / renewal signal |
| Insist on Highest Standards | KM Coach / runbook reuse | Repeat questions down, defects stay fixed |
| Earn Trust / Hire-Develop | Scrum Master 12-person / cross-team unblock | Delivery unblocked across teams |

Mechanics: LPs in EVERY round, not just behavioral. "I" not "we". Data + recency. 2–3 stories per LP in bank.

## 6. Intro spine — Jesus, 23-yr Oracle (90 sec)

> "I'm Jesus — 23 years solving migration and performance problems for enterprise Oracle customers: RAC, Data Guard, GoldenGate, AWR-driven tuning, and partnering with Engineering on product fixes.
> I do the same job this role describes: lead strategic customers onto a new architecture — now Aurora DSQL active-active distributed SQL — define the best practices, and channel field feedback back to Eng.
> I troubleshoot Understand-Prepare-Identify-Support, lead with the first data, and leave fixes that stay fixed.
> I'm targeting Principal Database Engineer, Distributed SQL in Seattle because customer-led adoption of multi-region correctness at scale is exactly the problem I've spent my career on."

Gap line (honest): "My gap is hands-on serverless-AWS depth versus Oracle internals — closing it with labs in this 15-day plan, and where I'd need the service team I'll say so."
Standing fact: Exceeds-Expectations-level performer since 2018 (mirror from prior kit — update title/year to current record before quoting).
