Skip to content
FARREZ AL HAKIM
View

Back

FRZ-13

Flash Sale Lab

Type
Personal
Status
Pilot
Period
2026

Overview

A flash sale lab under a real load test: almost 114 thousand buyers and bots fight over 6,000 items, sold out at second 42 without a single oversell, and the recording plays back second by second for non-engineers.

Load test replayScaling simulatorInteractive explainer and labSystem Design Lab

Architecture

  1. Thousands arrive

    k6 sends buyers and bots at once, more than a thousand people a second, at a Go API limited to one CPU.

    • k6 (load test)
    • Go
  2. Bots stop at the door

    A per-client rate limit and signed tickets turn bots away before they touch the stock.

    • Signed ticket
    • Redis
  3. The waiting room

    A Redis queue calls 200 people a second to the till, so checkout never floods.

    • Waiting room
    • Redis
  4. Stock can't go negative

    Checking stock, reducing it and saving the order happen in one step, and a double click is still one order.

    • Redis
  5. Saved for good

    A worker moves orders into PostgreSQL, and every second of the test is recorded for the replay page.

    • Go
    • PostgreSQL
    • Next.js
Features
  • Waiting room
  • No oversell
  • Second-by-second replay
Stack
  • Go
  • Redis
  • PostgreSQL
  • Next.js
Infrastructure
  • Docker
  • k6 (load test)

Full flow

Ready to playGymnopédie No. 1 (Satie)Robin Alciatore, MusopenPublic domain

Everything, from piano to jazz, in turn.