Writing
Notes on reliability.
Short pieces on the patterns I reach for when a bug would move money the wrong way: idempotency, explicit state machines, and keeping data correct under load.
- Exactly-once money movement: surviving retries and duplicate webhooks
Why check-then-act double-charges under concurrency, and how claiming a unique key at the database turns at-least-once delivery into exactly-once processing.
- Model the lifecycle as a state machine, not a bag of booleans
Boolean flags drift into impossible states. An explicit guarded state machine over an append-only log keeps a system's state trustworthy and explainable.