🐘 PostgreSQL (your default database)

Core β†’ Advanced

  • SQL fluency: joins, CTEs, window functions, GROUP BY/HAVING, LATERAL, upserts (ON CONFLICT)
  • Schema design: normalization (to 3NF) and deliberate denormalization; constraints (FK, UNIQUE, CHECK, exclusion constraints ⭐ for seat/time overlaps)
  • Data types: jsonb, arrays, uuid, timestamptz (always), numeric for money, enums
  • Indexes: B-tree, composite ordering, partial, covering (INCLUDE), expression, GIN (jsonb/full-text), GiST, BRIN
  • EXPLAIN (ANALYZE, BUFFERS): seq scan vs index scan vs bitmap; row estimates; join strategies
  • MVCC, VACUUM/autovacuum, bloat, transaction ID wraparound (awareness)
  • Isolation levels in Postgres (Read Committed default; Repeatable Read = snapshot; Serializable = SSI)
  • Locks: row locks, FOR UPDATE, SKIP LOCKED (job queues), advisory locks, deadlock detection
  • Connection pooling: HikariCP / pgxpool + PgBouncer (transaction mode caveats)
  • Replication: streaming (physical), logical replication; read replicas; failover (Patroni awareness)
  • Partitioning (declarative, range/list/hash); when to shard (Citus awareness)
  • Full-text search (tsvector); pgvector for embeddings ⭐
  • Observability: pg_stat_statements, pg_stat_activity, slow query log, auto_explain
  • Backups: pg_dump vs PITR (WAL archiving)
  • Zero-downtime migrations (add a column nullable β†’ backfill β†’ constraint; CREATE INDEX CONCURRENTLY)

πŸ§ͺ Labs (🟒 warm-up β†’ 🟑 core β†’ πŸ”΄ hard β†’ ⚫ boss)

  • 🟒 pgexercises.com (all sections)
  • 🟑 5M-row runs/run_events: optimize 5 queries with EXPLAIN; before/after
  • πŸ”΄ An RLS multi-tenancy + cross-tenant test suite
  • πŸ”΄ A SKIP LOCKED task queue with leases; partition run_events by month
  • ⚫ Zero-downtime migration drill: add a NOT NULL column + an index to a hot table under load (lock_timeout, CONCURRENTLY)

🧠 Cognitive tasks

  • Predict β†’ verify plans, lock waits, and bloat
  • Symptom β†’ hypotheses: β€œDB CPU 90%, same QPS as yesterday”

πŸ›°οΈ Orbit integration

  • Control plane DB, engine event history, pgvector for RAG

Go deeper

Resources

  • PostgreSQL docs ⭐ (very high quality) Β· Use The Index, Luke ⭐ Β· The Art of PostgreSQL (Fontaine)
  • PostgreSQL 14 Internals (Rogov, free) Β· Crunchy Data + pganalyze blogs Β· CMU 15-445