9 November 2026

Posts published on funGyaan on 9 November 2026.

November 2026

MTWTFSS
1
2345678
9101112131415
16171819202122
23242526272829
30

  1. How do queues schedule millions of delayed retries?

    "Retry this in 30 seconds", a million times over. A min-heap, a timing wheel, and a row in PostgreSQL with an index on its due time, measured: what each costs to add, cancel and fire, how late jobs run, and what survives a restart.

    · 11 min read · Data Structures

  2. Why isn't a Redis lock enough?

    A Redis lock is a lease: it expires whether or not its holder is done. Measured with Redis 7.4 and PostgreSQL 17: a paused holder overwriting newer data, a release that frees someone else's lock, a cron job running twice, and what fixes each.

    · 10 min read · Databases

  3. Why is there an append-only log under queues, databases and the outbox?

    PostgreSQL's WAL, Kafka's partitions, a transactional outbox and an event-sourced store are all the same structure: records appended to the end, read in order, never changed. Why appending is the shape durability takes, what an fsync costs, and how group commit gets 30x more out of the same disk…

    · 10 min read · Data Structures

  4. Should you lock the row or retry on conflict?

    Pessimistic locking (SELECT … FOR UPDATE) vs optimistic retries (a version column) vs a single atomic UPDATE, measured on PostgreSQL 17 at high and low contention, plus 50 buyers rushing the last 10 tickets.

    · 12 min read · Databases

  5. Why did adding a cache make our data wrong?

    A cache is a second copy of your data with its own rules, and every way it can disagree with the database shows up as a bug. Five failure modes measured with Redis in front of PostgreSQL, and the fix for each.

    · 11 min read · System Design