Featured
Every upstream call spends money and quota. A layered defence of validation, rate limits, caching, single-flight and leases keeps both under control.
19 min
Topic 03 / 08 · 03 articles
About this topic
117 words
Backend systems fail in boring, repeatable ways: a message is delivered twice, a retry charges a customer again, a third-party API rate-limits you at the worst possible moment. The fixes are rarely clever — they are disciplined.
Here I write about the patterns that make services correct under real-world conditions: idempotent consumers for at-least-once queues, dead-letter topics as a safety net, protecting paid upstream APIs with validation, caching and locks, and using one schema to drive validation, types and API documentation at the same time.
The examples are in TypeScript on Node.js, usually with Fastify and Google Cloud Pub/Sub, but each article explains the underlying idea first so you can apply it in whatever stack you run.
Featured
Every upstream call spends money and quota. A layered defence of validation, rate limits, caching, single-flight and leases keeps both under control.
19 min
· 15 min
A dead-letter queue turns a stuck message into a ticket instead of an outage. How I set one up on Pub/Sub, alert on it, and replay safely after a fix.
15 min
· 17 min
Pub/Sub will deliver some messages twice, and that is by design. Here is how to build consumers whose side effects happen once anyway, with working code.
17 min
· 19 min
Every upstream call spends money and quota. A layered defence of validation, rate limits, caching, single-flight and leases keeps both under control.
19 min