Skip to content

Blog: notes on backend, data and AI

Notes on backend engineering, data and building products with AI.

70 posts · page 2 of 7

RSS feed

November 25, 2026 · 4 min read

Syncing MySQL to Elasticsearch and BigQuery, and detecting drift

MySQL stays the source of truth while search and analytics stores hold derived copies. Feed them through outbox or CDC, version the writes, reindex behind an alias and check regularly for drift.

elasticsearchbigquerydata-engineering

November 25, 2026 · 4 min read

Online schema changes without downtime

An ALTER on a big production table can block every query behind it. What MySQL 8 does instantly, why metadata locks cause outages, when to use gh-ost, and expand-contract releases.

mysqlmigrationsdevops

November 25, 2026 · 3 min read

Tables with hundreds of millions of rows: a staged plan

When a transactions table keeps growing and slowing, work from cheap to expensive: fix queries, archive old data, partition by time, offload reads, and shard only as a last resort.

mysqlpartitioningscalability

November 25, 2026 · 4 min read

Hot rows: when one balance becomes the bottleneck

A merchant wallet that receives hundreds of payments per second makes every transaction queue on the same row lock. Adding connections does not help. Splitting the row or batching the updates does.

mysqlperformancelocking

November 25, 2026 · 4 min read

Dual writes and the transactional outbox

Writing to a database and then publishing to a broker are two separate systems, so one can succeed while the other fails. The outbox pattern makes the event part of the same transaction.

distributed-systemskafkamysql

November 25, 2026 · 3 min read

The saga pattern: local transactions, compensation and state

A saga replaces one big distributed transaction with a chain of local ones and a compensating action per step. It needs a persisted state, idempotent steps and a sweep for stuck sagas.

distributed-systemssagapayments

November 25, 2026 · 3 min read

Two-phase commit and XA: why it is hard to live with

Two-phase commit gives a real atomic commit across several databases, at the price of blocking, latency and a coordinator that must never be lost. Here is how it works and why microservices avoid it.

distributed-systemstransactionsmysql

November 25, 2026 · 4 min read

Idempotency keys for APIs and message consumers

Networks retry and brokers redeliver, so every operation that moves money must be safe to receive twice. A unique key and a stored result make a repeat harmless.

paymentsapiidempotency

November 25, 2026 · 4 min read

Safe transfers and double-spend prevention in one database

A correct transfer is one short transaction: record it once, lock the wallets in a fixed order, check and subtract atomically, write balanced ledger entries and commit.

paymentstransactionslocking

November 25, 2026 · 4 min read

Designing money columns and ledgers

Store money as integers in the smallest unit, keep an append-only ledger as the source of truth, and let a balance column be a cache. Double-entry makes errors easy to detect.

paymentsledgerschema-design

Have a project in mind?

Tell me what you are building. I reply by email, usually within two working days.

Start a conversation