Skip to content

Field notes

Writing

Deep dives on problems from my own projects: the trade-offs I made, the code that does the work, and where each approach stops working. For how these choices add up, see How I work.

  1. 4 min read

    One round trip: atomic rate limiting with Redis Lua

    Why a rate limiter shared by many instances needs the read, the decision and the write to be one indivisible step, and how two short Lua scripts get there at 1.33 ms p95.

    • Go
    • Redis
    • Distributed systems
  2. 4 min read

    Matching road trips that share a road, in PostGIS

    How Musafir decides that two different trips drive the same stretch of road: slicing routes, sampling points, checking headings, and why the geometry and geography types both show up.

    • PostGIS
    • SQL
    • Geospatial