When the Deadline Made the Solution Better

We had to ship a feature in two weeks that relied on MySQL auto-increment behavior. Problem: our production database was MySQL 5, which handles auto-increment differently than MySQL 8 after a restart. The MySQL 8 migration was scheduled for two months out. We needed to ship now. The “temporary fix” became permanent architecture improvement. The Situation We were building a resource allocation feature that tracked which resources were assigned to which entities. ...

November 15, 2025 · 3 min · Leen

PostHog Client IPs Behind Reverse Proxies: A Gotcha

PostHog wasn’t tracking client IPs correctly behind my reverse proxy. NextJS logged the right IPs, Caddy sent the right headers, but PostHog’s dashboard showed everyone visiting from my VPS in Frankfurt. This broke geographic analysis and location-based feature flags. Here’s what I tried and what actually worked. The Setup My application stack: NextJS application Caddy reverse proxy (handles SSL) PostHog Cloud for analytics The proxy setup is standard: Caddy receives requests, sets proper headers, passes them to NextJS. ...

October 22, 2025 · 4 min · Leen

Debugging ProxySQL Query Routing: Transaction Gotchas

Originally published April 2024. Substantially updated October 2025 with expanded analysis and debugging insights. I spent 3 days debugging why ProxySQL wasn’t redirecting queries to read replicas. I checked the configuration. I verified queries redirected when using the CLI. I confirmed auto-commit was enabled. I read the docs cover to cover. The problem? My test framework. The test setup created nested transactions with writes, which pinned everything—including my auto-commit query—to the primary DB. ProxySQL was working fine. My testing setup was broken. ...

April 30, 2024 · 5 min · Leen