
Rate Limiting Architecture: Token Bucket vs Sliding Window in a Distributed System
Token bucket and sliding window algorithms have different fairness properties under burst traffic. The Redis Lua script that got us from theory to production.
Clean code practices, system design, architecture patterns, and development methodologies

Each team chose a different API style and each has regrets. An honest retrospective on the trade-offs that emerged in practice rather than in architecture diagrams.

Token bucket and sliding window algorithms have different fairness properties under burst traffic. The Redis Lua script that got us from theory to production.

Autovacuum's defaults were designed for small databases. A few parameters make a large difference at scale — and the documentation buries the relevant ones.

Dead tuples from MVCC accumulate in indexes differently than in tables. We hit a production stall from index bloat on a 400 GB table. Here is how we diagnosed and fixed it.

Terraform state drift from manual console changes caused a partial outage during a routine apply. The detection tooling and PR policy that prevents recurrence.

Security work competes with feature delivery on the same roadmap. A structured approach to making the trade-off explicit and defensible to both engineering and product.

Most internal RFCs are written for the author, not the reviewer. A format shift and a forcing function — a 48-hour async comment window — changed adoption rates on our team.