Writing
Notes on engineering
How I design systems that stay correct: real decisions from products I build, with the trade-offs.

Database per tenant: notes on a different kind of multi-tenancy
Most SaaS apps share one schema with a tenant_id column. For a point-of-sale system I built, I gave every customer their own PostgreSQL database instead. Here is when that is the right choice, and the four problems you must solve to make it work.
- System design
- PostgreSQL
- Multi-tenant SaaS
- Go

Guardrails for AI agents that touch real data
Notes from building an AI assistant that turns plain-language sentences into accounting entries. The model is useful, but it must never be the part that writes. Here are four guardrails that make sure of that.
- AI agents
- LLM
- System design
- PostgreSQL

Offline-first sync without double counting
When a client works offline and retries, the classic bug is saving the same thing twice. How to make retries always safe with an outbox, client-generated IDs, stored results, and conflicts that never block the queue.
- Offline-first
- Idempotency
- Distributed systems
- PostgreSQL