Writing

Lessons that cost something to learn

No tutorials on things I have not run. Every article comes out of a decision I had to make, defend and then live with in production - and every one starts with a plain-language summary of the problem and why it costs money, before the technical detail begins.

  • 11 articles
  • 5 disciplines
  • 122 minutes of reading
Subscribe via RSS

Read Never Stop the Old Container First
DevOps15 min

Never Stop the Old Container First

A routine deploy costs about a minute of failed requests, because "update" quietly means stop-then-start. Here is the pipeline that ships to a single server without a customer ever seeing an error - no Kubernetes, no second load balancer, and a rollback that is the same path as the deploy.

  • Docker
  • Traefik
  • GitHub Actions
  • CI/CD
Read
Read Selling With the Wi-Fi Down: An Offline-First POS in Tauri 2.0
Full stack13 min

Selling With the Wi-Fi Down: An Offline-First POS in Tauri 2.0

A till that stops working when the internet does is a till that loses money. Here is the contract that lets a desktop point of sale keep selling through an outage and reconcile exactly once when the connection returns - without ever charging a customer twice or losing a sale from the books.

  • Tauri
  • React
  • SQLite
  • Django
Read
Read Decomposing a Monolith Without a Rewrite
Architecture11 min

Decomposing a Monolith Without a Rewrite

Splitting a large codebase is usually sold as a rewrite and delivered as a disaster. Here is how to do it piece by piece while the product keeps shipping to customers - plus an honest account of what independent deployment actually costs you in return.

  • Architecture
  • Microservices
  • Django
  • Refactoring
Read
Read Leases Over Locks: A Crash-Safe Work Queue in PostgreSQL
Distributed systems10 min

Leases Over Locks: A Crash-Safe Work Queue in PostgreSQL

How to get a crash-safe job queue out of the database you already run, instead of adding another service to operate, monitor and be woken up by. Workers claim jobs on a timed lease, so a machine dying halfway through costs minutes of delay rather than lost work.

  • PostgreSQL
  • Distributed Systems
  • Queues
  • Python
Read
Read Four Stages of Deduplication: Spend Your Compute Where It Matters
AI engineering11 min

Four Stages of Deduplication: Spend Your Compute Where It Matters

The expensive way to find duplicates is to compare everything using AI. Ordering the checks cheapest-first removes roughly nine in ten duplicates with a simple lookup and saves the costly comparison for the small remainder - the same quality of result, at a fraction of the running cost.

  • Deduplication
  • SimHash
  • Embeddings
  • pgvector
Read
Read At-Least-Once Is a Promise You Have to Keep
Backend10 min

At-Least-Once Is a Promise You Have to Keep

Retries are what stop a system losing work - and what make it do the same work twice. This is how to get the reliability without the duplicates: handlers safe to re-run, retries that back off, a dead-letter queue you can actually triage, and recovery for messages a crashed worker left behind.

  • Redis
  • Streams
  • Reliability
  • Python
Read
Read Schema-per-Tenant Django: Isolation You Cannot Forget to Apply
Architecture12 min

Schema-per-Tenant Django: Isolation You Cannot Forget to Apply

Sharing one database between customers is one forgotten filter away from showing one client another client's data. Giving each customer their own separate space moves that safety from something developers must remember into something the database enforces - and here is exactly what it costs.

  • Django
  • PostgreSQL
  • Multi-Tenancy
  • SaaS
Read
Read Holding 10k Daily Users Before You Buy a Bigger Server
DevOps11 min

Holding 10k Daily Users Before You Buy a Bigger Server

A platform went from a few hundred to 10,000+ daily users without a bigger server. Four fixes did all the work - and buying hardware first would have hidden every one of them while the monthly bill kept growing.

  • PostgreSQL
  • PgBouncer
  • Django
  • Performance
Read
Read One API, Three Clients: A Dashboard, a Phone and a Turnstile
Full stack10 min

One API, Three Clients: A Dashboard, a Phone and a Turnstile

What changes when one backend must serve a web dashboard, a phone app, and a fingerprint terminal that cannot be updated, cannot be trusted about time and is usually offline. The most awkward client turned out to be the best specification the API ever got.

  • API Design
  • Django
  • React Native
  • IoT
Read
Read Let the Agent Propose, Not Write
AI engineering10 min

Let the Agent Propose, Not Write

The single boundary that separates an AI feature you can safely point at real customer data from a demo you cannot: the model proposes, the application decides. Plus validated output, provider failover and cost tracking treated as engineering problems rather than prompting problems.

  • LLM
  • Agents
  • Gemini
  • LangChain
Read
Read A Release Should Be One Git Tag
Engineering practice9 min

A Release Should Be One Git Tag

Every manual step in a release is a step somebody skips at 11pm - and the skipped step is the one customers find. How a forty-minute checklist became one command, with version numbers, release notes, builds and publishing all produced by automation.

  • Python
  • Poetry
  • GitHub Actions
  • CI/CD
Read

Topics covered

  • API Design
  • Agents
  • Architecture
  • CI/CD
  • Concurrency
  • Deduplication
  • Deployment
  • Distributed Systems
  • Django
  • Docker
  • Embeddings
  • Gemini
  • GitHub Actions
  • Idempotency
  • IoT
  • LLM
  • LangChain
  • Leadership
  • Microservices
  • Multi-Tenancy
  • Multilingual NLP
  • Offline Sync
  • Offline-First
  • Open Source
  • Performance
  • PgBouncer
  • Poetry
  • PostgreSQL
  • Python
  • Queues
  • RBAC
  • React
  • React Native
  • Redis
  • Refactoring
  • Reliability
  • SQLite
  • SaaS
  • SimHash
  • Streams
  • Tauri
  • Traefik
  • Versioning
  • WebSocket
  • Zero Downtime
  • pgvector