Engineering Notes

How I reason about system design: how I frame the problem, the principles I rely on, the trade-offs I weighed, and what I'd do differently.

Building an in-memory database: from one thread to many machines
A key-value store with nested transactions, grown step by step: single-threaded Java, then thread-safe with optimistic concurrency, then what breaks when it's distributed.
Idempotency belongs to the whole payout path, not one endpoint
A retry can come from the user, the client, a worker, or a batch job. Every layer needs an answer.
Diff-based pipelines: faster builds without false confidence
Skipping work is easy. Skipping only the work that's safe to skip is the hard part.
Why I prefer binlog-based sync over dual writes
Keeping MySQL and Elasticsearch consistent without making every write path care about search.
Designing a delayed-job scheduler: time wheel vs. Redis sorted sets
Two good answers with different failure modes. Which one fits depends on scale and how much state you can afford to lose.