build-with-mhonn

Side build

Marketplace and k6 Load Testing

A small online marketplace built as a realistic workload for the Kubernetes platform, then load tested with k6. Real data, money moving between wallets, and real ways to go wrong under load.

The problem

A platform is only convincing when it carries something that can fail. A marketplace has the right failure modes: oversold stock, double charges and half-finished purchases.

What I built

  • Three small FastAPI services (accounts, inventory, checkout), one static web page, and a Postgres database per service.
  • Purchase saga: reserve stock, transfer money, confirm, and compensate if a step fails.
  • Idempotency keys so a retried purchase never charges twice.
  • Four invariants checked by script after load: wallets sum to what was seeded, no negative stock, money taken equals money recorded, units sold equal units committed.
  • k6 scenarios for browse, cart, checkout and a flash sale, with thresholds that turn a run into pass or fail.

Screenshots