Blog: notes on backend, data and AI
Notes on backend engineering, data and building products with AI.
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 20, 2026 · 2 min read
CAP theorem and consistency models in plain words
During a network partition a system must choose between consistency and availability. Strong and eventual consistency explained with simple examples.
architecturedistributed-systems