Capturing PostHog Events in Rails Without the Footguns
The docs suggest one pattern. Production suggests another. Here's what actually survived.
Long-form notes on building software, mostly from the trenches.
The docs suggest one pattern. Production suggests another. Here's what actually survived.
Everyone reaches for ETS as a cache. Fair enough — it's fast and it's there. But the interesting patterns show up when you stop thinking of it as a key-value store and start treating it as shared mutable state with read concurrency. Three patterns from real Elixir services that held up under load.
Sidekiq's exponential backoff looks simple until your job fails at 2am and you're doing napkin math on when retry number fourteen will fire. The formula is public but the implications aren't obvious. Here's how to think about retry windows, dead queues, and when to just let a job die.
Past-tense verbs, no abbreviations, one spreadsheet. A simple system that kept six teams from inventing six vocabularies for the same user actions. The convention matters less than having one at all.
The timeout option in GenServer.call looks like a safety net. It isn't. It's a local-only timer that tells the caller to give up — the server keeps running, the work keeps happening, and now you have two problems. What to reach for instead.