Skip to content

systems snippets

The engineering under my client work, small enough to poke at. Each one is a real rule from a shipped product.

  1. Escrow that can’t pay twice

    Buyer money sits in escrow while the order moves through a fixed lifecycle. Money moves only on certain transitions, each webhook is verified, a refund happens once, and a dispute has to be resolved rather than forced.

    The Zaroba case study
    • payment_pending
    • payment_received
    • preparing
    • shipped
    • delivered
    • completed
    • disputed
    • cancelled
    Buyer wallet
    ₦50,000
    Escrow
    ₦0
    Seller
    ₦0

    order created · payment_pending

  2. The last seat, booked eight times

    Eight people book an event with five seats at the same moment. Read-then-write lets them all through. One atomic update gives five seats and a waitlist of three.

    The Toli case study
    seatsseats_left = 5
    ABCDE
    waitlist
    FGH

    Press run to send 8 bookings at once.

    update events
    set seats_left = seats_left - 1
    where id = $1 and seats_left > 0
    returning seats_left;
    -- 0 rows returned: waitlist
    Simulated interleaving, not real network calls.
  3. Only the wheels that fit

    Customers shop by their car. The search matches bolt pattern, centre bore, offset and diameter, so a wheel that won’t go on the car never shows up as an option.

    The Tottenham Wheels case study
    • PCD 5x112
    • Bore 57.1
    • ET 35–50
    • 16–19"

    2 of 10 wheels fit a Volkswagen Golf Mk7 (2013–2020)

    Fits (2)

    • Ridge 17

      17" · 5x112 · ET45 · 66.6

      £189

      Fits

    • Apex 18

      18" · 5x112 · ET40 · 57.1

      £239

      Fits

    Doesn't fit (8)

    • Sprint 16

      16" · 5x100 · ET40 · 57.1

      £149

      PCD 5x100

    • Torque 19

      19" · 5x120 · ET35 · 72.6

      £289

      PCD 5x120

    • Vento 17

      17" · 5x120 · ET38 · 72.6

      £199

      PCD 5x120

    • Drift 18

      18" · 5x114.3 · ET45 · 67.1

      £219

      PCD 5x114.3

    • Slate 17

      17" · 5x108 · ET48 · 63.4

      £179

      PCD 5x108

    • Mono 19

      19" · 5x112 · ET55 · 66.6

      £269

      offset 55 > 50

    • Flux 20

      20" · 5x120 · ET40 · 72.6

      £329

      PCD 5x120

    • Pilot 15

      15" · 4x108 · ET42 · 63.4

      £129

      PCD 4x108

    Sample fitment data. The real search runs over the shop's catalogue.