Context
Failures in a distributed architecture are difficult to explain with a static diagram: local saturation can fill a queue, slow a dependency, and then degrade the entire user journey. Surgyah turns those invisible relationships into an interactive, progressive experience.
Challenge and constraints
Model capacity, queues, dependencies, and incidents faithfully enough to produce useful outcomes while keeping every consequence understandable to someone discovering resilience.
Approach
I isolated a pure TypeScript engine that compiles the graph and computes each state without relying on system time or an external service. Three guided missions apply a traffic spike, an API outage, and a PostgreSQL failure; the interface displays their propagation, metrics, and causal chain live.
Decisions and tradeoffs
The public demo runs the engine in the browser to remain immediate, free, and self-contained, but it does not persist runs. The same engine can also run in a Docker architecture where Next.js records runs, Redis Streams feeds a Bun worker, and SSE streams results.
Observable outcome
The live version lets users edit an infrastructure, run 18 deterministic steps, track CPU, queues, latency, and success rate, and compare two runs before and after an improvement. The repository also documents and tests the distributed PostgreSQL, Redis, and worker journey.