Series
Databases from the Engineer's Perspective
Storage engines, indexes, query lifecycle, transactions, and concurrency — from an application engineer's perspective, grounded in production experience with both PostgreSQL and MongoDB.
4 published · 1 upcoming
- Part 1Published
Storage Engines: How PostgreSQL and MongoDB Actually Write to Disk
Most engineers treat the database as a black box — until production breaks. This article builds a deep mental model of how PostgreSQL (heap + WAL + MVCC) and MongoDB (WiredTiger B-tree + journal) actually store and retrieve data, and how those design choices shape every architecture decision you make.
- Part 2Published
How Indexes Work Under the Hood: B-Tree, Hash, and Beyond
Indexes are the single most misunderstood tool in a database engineer's toolkit. This article goes deep into how B-Tree, Hash, GIN, and partial indexes physically work in both PostgreSQL and MongoDB — and why that knowledge changes the way you design schemas, write queries, and diagnose performance regressions.
- Part 3Published
The Query Lifecycle: From Your Application Code to Disk and Back
Every query your application sends travels through a precise sequence of stages before results come back. Understanding that sequence — parsing, rewriting, planning, execution, and result transport — is what separates engineers who guess at performance problems from engineers who diagnose them systematically.
- Part 4Published
Transactions, ACID, and What Consistency Actually Costs You
ACID is one of the most cited and least understood guarantees in database engineering. This article goes beneath the acronym — into what atomicity, consistency, isolation, and durability actually mean at the storage level, what each isolation level permits and prevents, and how PostgreSQL and MongoDB make fundamentally different trade-offs on the same concurrency problems.
- Part 5In progress
Concurrency Control: How PostgreSQL and MongoDB Handle Simultaneous Writers
Concurrency control is where database theory meets production reality. This article goes deep into how PostgreSQL and MongoDB handle simultaneous readers and writers — the full MVCC mechanism, every lock type, how contention manifests, and the systematic approach to diagnosing and resolving it before it becomes an incident.