Skip to content
SJ

Writing

Notes on building systems

Longer-form writing about backend architecture, event-driven design, and the parts of production engineering that only show up in year two.

12 min read

Making a Postgres App Faster, in Order

Indexes, N+1s, round trips, caching — in that order, because caching a bad query just buys you a fast wrong answer and a stampede at expiry.

PostgreSQLPerformanceIndexingCachingBackend
Read article
10 min read

Two Files That Give an AI Agent a Memory

Coding agents start every session cold, and code records what it does but never why. Two files in the repo — one append-only, one living — fix more than a better prompt ever will.

AI AgentsClaude CodeCursorDocumentationWorkflow
Read article
12 min read

Cache Invalidation with Debezium: Let the Database Tell You

Invalidating from application code only works if application code is the only thing that writes. Postgres logical replication turns every committed row change into the signal instead.

DebeziumPostgreSQLRedisCDCBackend
Read article
11 min read

Why Notifications Need an Integrated Event Source

Preferences, digests, dedup and audit are all functions over a stream of facts — and you cannot write a function over a stream you never materialised.

ArchitectureEvent-DrivenNotificationsBackend
Read article