Databases

Schema design, IDs, connection pooling and query performance.
11
Nov
Row of metal lockers with padlocks on doors

SKIP LOCKED: Claim the Next Job in One Statement, Then Test It on Real Postgres

Claiming queue work with one FOR UPDATE SKIP LOCKED statement, and why that forces your tests onto a real Postgres with cloned template databases.
6 min read
02
Nov
A glowing fingerprint on a dark circular scanner surface with concentric lines

Don't Let the LLM Name Your Entities

An LLM called one credit card three different names and my app created three accounts. Use model output for meaning, never for identity: key records on facts the model copies, not labels it writes.
6 min read
18
Dec
Street photograph by Stalin Pereira

Detecting N+1 Queries in Production Logs

Visual guide to detecting ORM issues and fixing with eager loading
1 min read
16
Dec
Street photograph by Stalin Pereira

Configuring PgBouncer for Serverless High Concurrency

Serverless functions turn traffic spikes into connection storms that can take Postgres down. Here's how PgBouncer's transaction pooling absorbs them: a production-ready config, pool sizing, what transaction mode breaks, and when a managed pooler is the better fit.
8 min read
10
Dec
Street photograph by Stalin Pereira

Collision Probability: Why 'Auto-Number' Feels Safe but Isn't

The math behind why CUIDs are safe enough for Google, and why Auto-Numbers create merge conflicts
2 min read
08
Dec
Street photograph by Stalin Pereira

Time-Sortable IDs: The Hidden Power of ULIDs

How combining a timestamp with randomness (ULID/CUID) gives you sorting for free without a `created_at` index
2 min read
30
Nov
Street photograph by Stalin Pereira

UUIDv4 is Killing Your Database Performance

Random UUIDv4 primary keys scatter inserts across your B-tree index, bloating it, thrashing the cache and inflating WAL. Here's how to measure the damage, and how UUIDv7 (RFC 9562, native in PostgreSQL 18) fixes it without giving up what made UUIDs useful.
8 min read
30
Nov
Street photograph by Stalin Pereira

Stop Using Auto-Increment IDs: The Security Risk

Why sequential IDs (1, 2, 3) leak business intelligence to competitors (enumeration attacks)
1 min read
23
Nov
Street photograph by Stalin Pereira

A Practical Guide to Implementing Semantic Search with Vector Databases (e.g., Pinecone, Milvus)

Beyond Keywords: Why Vector Databases Are the Real Future of Semantic Search, Not Your Old Fuzzy Search Hacks
1 min read