# Roblox-Postgres-Study — START HERE

Principal Software Engineer, Roblox Database (San Mateo, hybrid). Posting asks 8+ yrs distributed DB/storage-engine depth: Postgres/MySQL/RocksDB/Spanner/Aurora/AlloyDB internals, Raft/Paxos multi-region replication, high-QPS low-latency on K8s/Nomad, engine features + control plane + tail-latency + OSS upstream. Pay band ~$294–343K, reports to Technical Director Storage.

Role essence (from the live posting): **build the multi-tenant database platform at elastic scale** — ship engine features (indexing, storage formats, WAL/replication protocols, sharding, planner), own the control plane (elastic scaling, autonomous healing, zero-downtime schema/tenant moves across regions), kill tail latency with kernel-level tracing, automate everything, mentor, and push fixes upstream to Postgres/RocksDB.

## One-sentence rule

> Every answer: state the mechanism, the first measurement you would pull, and the internals trap you ruled out — in that order.

## Scoring words (use aloud daily)

Ownership · Deep internals · B-tree · MVCC · WAL · planner · buffer pool · LSM · compaction · quorum · failover · RTO/RPO · elastic scale · tail latency · p99 · STAR with metric.

## 12-day plan (Nov 5–16)

| Day | Date | Focus | Audio | Lab |
|-----|------|-------|-------|-----|
| 1 | Nov 5 | PG architecture: processes, shared buffers, WAL writer, checkpointer | E1 | Local PG install, pgbench smoke, read pg_stat_activity |
| 2 | Nov 6 | MVCC: snapshots, xmin/xmax, vacuum, bloat | E2 | Bloat-and-vacuum lab, HOT-update demo |
| 3 | Nov 7 | WAL + replication: LSN, streaming, lag, failover | E3 | Replica lag drill, switchover vs failover write-up |
| 4 | Nov 8 | Indexing: B-tree, partial/covering, bloat, write amplification | E4 | Slow-query index fix with EXPLAIN ANALYZE |
| 5 | Nov 9 | Planner + optimizer: stats, ANALYZE, join choices, misestimates | E5 | Broken-plan triage (stale stats → ANALYZE → verify) |
| 6 | Nov 10 | RocksDB/LSM: memtable, SSTs, compaction, read/write amplification | E6 | Compaction-reading lab, tuning-knob narration |
| 7 | Nov 11 | Consensus: Raft/Paxos, leader election, quorum, split-brain | E7 | 3-node quorum loss table, fencing write-up |
| 8 | Nov 12 | K8s for stateful DBs: operators, StatefulSets, storage, zero-downtime moves | E8 | Tenant-move runbook draft, PDB/disruption drill on paper |
| 9 | Nov 13 | Tail latency: p50/p99, kernel tracing, eBPF/perf narration, noisy neighbor | E9 | pgbench latency-histogram read + mitigation plan |
| 10 | Nov 14 | System design: multi-tenant sharded PG at Roblox scale | E10 | Marketplace buy/sell whiteboard + design review |
| 11 | Nov 15 | STAR story bank + intro spine + OSS-upstream framing | E10 | Timed STAR reps, 90-sec intro spine |
| 12 | Nov 16 | Mock loop: internals deep dive + design + behavioral | E10 | Full timed mock, gap list |

## Files inventory

| File | What it is |
|------|------------|
| `00_START_HERE.md` | This file: plan, rule, scoring words |
| `STUDY_PLAN.md` | Daily repetition stack + Day 1–12 Focus/Listen/Lab/Say-aloud/Desk/Done-check + BASE-TO-BUILD |
| `CHEAT_SHEET.md` | Internals ladder, quorum lines, K8s method, latency drill, STAR index, intro spine (largest file) |
| `RESOURCES.md` | Official postgresql.org + RocksDB wiki + Raft paper links per day |
| `AGENTS.md` | Project conventions + Pages deploy |
| `scripts/` `audio/` `video/` `print/` `dist/` `tests/` | Episode txt, mp3+vtt, mp4+vtt, local-only, mirrors, checks |

Next: open [STUDY_PLAN.md](./STUDY_PLAN.md), then keep [CHEAT_SHEET.md](./CHEAT_SHEET.md) open during every lab.
