Krzysztof 'Chris' Hasiński's wroclove.rb 2023 talk framed around the 'here be dragons' metaphor (and the Lennox Globe's Latin 'HC SVNT DRACONES'): Rails developers treat databases as exotic storage boxes but most real work happens there. Observes that the canonical test pyramid doesn't apply to Rails — most Rails tests are integration tests because they hit the DB. Tours: (1) SQLite — public domain, extremely fast (the sqlite.org site itself serves ~20M SQL queries/day on a 7-year-old VM shared with 23 apps), embeddable, trivial backups (copy the file to run 5 parallel test DBs); downsides: process-level locking pushes you toward processes-over-threads, single writer forces retry logic, no full-text search. (2) PostgreSQL — the 'elephant in the room'; cites Stephan Schmidt's 'Use One Big Server / Postgres for Everything' article showing Postgres can replace GraphQL, cache, queue, etc. Highlights unlogged tables (supported in Rails 6 migrations, very fast but wiped on restart) — adding `create_unlogged_tables` to RSpec shaved ~3.5 minutes off a bad suite and ~20s off a good one. Window functions (OVER/PARTITION BY, ROW_NUMBER, cumulative SUM with ROWS BETWEEN) are 'parallel calculations' usable from Rails and much faster than doing it in Ruby; pattern-matches well with Ruby. EXPLAIN (with ANALYZE, BUFFERS) explained in detail: strategies as a tree (seq scan, hash, hash join), cost-to-first-row vs total cost, row-count estimates, width; use transaction+rollback for EXPLAIN ANALYZE on inserts/updates/deletes; BUFFERS will be default in Postgres 16/17. Speaker wrote a gem exposing `estimate_count` via EXPLAIN without requiring migrations. Indexes: one index per query (for filter or sort or both), PgHero (by Andrew Kane) for missing-index detection, vacuum analyze to monitor usage; try all column orders for geodata; partial indexes whose WHERE mirrors the query; covering indexes via INCLUDE for index-only scans. Extensions: PostGIS for geo, TimescaleDB for time series, and especially Citus (bundles columnar storage, distributed tables, parallel querying). Columnar storage = append-only, 10× compression, dramatic speedup on analytical reads; mix-and-match with row tables (cold partitions columnar, newest row-based). Distributed tables via `create_distributed_table` on a distribution column (e.g. customer_id) plus reference/collocated tables. (3) MySQL — superfast, supports in-memory tables (Postgres unlogged still writes sometimes); uses update-in-place + rollback segment for MVCC, unlike Postgres's write-new-row + stale-marking that requires VACUUM — faster because most transactions commit quickly. Now has JSON operators, window functions, full-text search — a serious alternative; Basecamp/HEY use it. (4) Exotic: CockroachDB — Citus-like auto-sharding + geo-aware distribution with hotspot detection, survives datacenter outages. ClickHouse — Russian, Yandex-origin, columnar, pre-computed aggregates, multiple table engines; Cloudflare uses it for ~6M inserts/second. Closes that NoSQL/document/graph is a 'part two for next year'. Images generated with Midjourney ('database as an animal'). Q&A: EXPLAIN cost values are 'story points' — unitless defaults you can tune in postgres.conf for your hardware; unlogged tables are wiped on DB restart/crash (fine for CI, confusing on local dev after Docker restarts).