Repository avatar
Other Tools
v1.0.0
active

querystorm

io.github.UsmanQasim/querystorm

Simulate system designs: latency, outages, scaling limits, cost, pros and cons, live links.

Documentation

Querystorm

A system design simulator you can break.

Sketch an architecture on a whiteboard, then watch traffic, latency, outages and the monthly bill react, live. Free, open source, runs entirely in your browser.

Open Querystorm · Use it from AI assistants · Watch the 70-second demo · How it works

CI MIT licence MCP server TypeScript Works offline

Taking a region offline: requests from three cities start failing, the board turns red, then recovers

Why

Most system design practice is reading. You draw boxes, you say "add a cache", and nobody checks whether it would have worked. Querystorm checks. Every box has a capacity, a latency, a failure mode and a price, so you find out that your single database tops out at 3k writes a second, that the cross-region call adds 68 ms, and that the CDN is most of the bill.

  • Build from 29 components: load balancers, autoscaling groups, Kubernetes, Lambda, Redis, SQL and NoSQL, global databases, queues, streams, Flink-style processors, warehouses, GPU inference, Stripe and OpenAI as external APIs.
  • Tune everything: region, instance size, replicas, shards, Multi-AZ, cache hit rate, users per city, read/write mix, payload, traffic shape.
  • Break it: lose a zone, lose a whole region, kill a node, cut a link, add latency, multiply traffic by ten, flush every cache.
  • See the bill: per-component monthly cost with tiered data transfer, and a cost tab that finds reserved, spot, ARM and billing-model savings.
  • Read how real systems work: 23 case studies (Netflix, Amazon Prime Day, Discord, Instagram, Figma, Dropbox, Uber, WhatsApp, Slack, Stripe, Shopify, Cloudflare, LinkedIn, Meta, Twitter, YouTube, Google Spanner, GitHub, Airbnb, Notion, Pinterest, Lyft, Zoom), each explained in plain words from the company's own engineering posts, with the key numbers, every source linked, and a board you can run.
  • Practise 115 problems, from a pastebin to a bank ledger, each with targets, design checks and a step-by-step reference solution. Live meters show where you stand while you build; Check my design grades you with up to three stars (meet the targets, survive a zone outage, handle twice the traffic), compares you with the reference answer and lists the trade-offs you made.
  • Learn one idea at a time: a course of 24 lessons in six modules, from following one request to building a URL shortener and a photo-sharing app end to end. Topics include latency, capacity estimates, scaling up vs out, caching, read replicas, sharding, search indexes, consistency, zone and region outages, slow dependencies, retries, rate limits, queues, pub/sub, streams, CDNs, serverless and cost. Each board is built up a part or two at a time with a note on what each part is and why it is there, each lesson has a broken system to fix with live checks, and the board can be viewed in 3D.
  • Interview with it: write your own challenge from a board, send it as a link, and get the candidate's design, scores and notes back as a link. No accounts, no server.

Screenshots

Board with a running global feed The board. Every number on every box is live.3D model of the same system The model. The same system as a 3D table model, regions as plates.
World map The map. Where users are, where their requests land, and what crosses an ocean.A region outage Chaos. One click takes N. Virginia offline.
Guided solution Guided solutions. Rebuild the reference design one step at a time, with the reasoning.Growth plan The next 12 months. Which month the design breaks, and which month it blows the budget.
Problem bank 115 problems. Filter by topic and difficulty, solve, or rebuild the answer step by step.Challenge editor Write your own. Capture the answer from the board, set targets and checks, send a link.
A lesson in progress Lessons. One idea, one broken system, one live check.Practice mode in dark theme Practice mode. A timed mock interview with notes for each stage.
Phone layout: the board Phone layout: component details Phones and tablets. Panels slide in.

Everything it does

AreaWhat you get
CloudsSwitch AWS, Google Cloud or Azure and every component shows that cloud's product name. The details panel says when to use it and what it costs you.
RoutingSplit connections share load and fail over; every request connections are calls made each time. Connections can carry only reads or only writes, retry, and trip a circuit breaker. GeoDNS and CDNs send each city to its nearest healthy region.
SimulationA 24-hour clock with daily waves, flash spikes and growth. Queueing latency, overload drops, autoscaling lag, queue backlogs, retry storms, per-city latency.
AdvisorSingle points of failure, missing Multi-AZ, hot spots, retry storms, cross-region data calls, a warehouse on the request path. Most come with a one-click fix.
Stress testsBreaking point ramps traffic until something gives and names it. A full day replays 24 hours minute by minute. The next 12 months grows traffic month by month against your budget.
Where the time goesPick a group of users to see every hop of an average request: network time, time inside each part, and what share of requests get there.
CompareSave versions of a design and compare latency, availability, cost and bottleneck side by side.
EstimateBack-of-envelope maths from daily users to peak requests, bandwidth, storage and rough server counts, then one click to turn it into users on the board.
Library23 company case studies with sources, key numbers and a step-by-step diagram, plus 115 problems in 21 topics, Easy to Hard, with search, filters and progress. Every problem has a reference solution you can rebuild step by step.
LearnA course of 24 lessons in six modules. Each lesson has the board in the middle, the step on the right and a Break it menu above the board; the task ticks off the moment the simulation shows it worked.
For interviewersBuild the answer on the board, capture it as solution steps, set targets and design checks (or let Querystorm set targets from your answer), test it, and copy a challenge link. The candidate presses Send to interviewer and you get a result link that opens their design with the 24-hour test results, the checks and their notes. Challenges also export and import as JSON.
Practice35, 45 or 60 minute mock interviews in five stages with prompts, a timer and a scored summary. Passed challenges are ticked.
EditingSticky notes, quick add (Ctrl K), copy, paste, duplicate, multi-select, tidy up, undo and redo, day and night themes.
SharingAutosave, share links that hold the whole design, JSON import and export, PNG export of the board, and a Markdown design doc with your notes.
AnywhereWorks on phones and tablets, installs as an app, and keeps working offline after the first visit.

Use it from any AI assistant

Querystorm is built to be used by AI assistants as well as people. An assistant writes the design as a few lines of text, Querystorm simulates it, and the user gets the numbers, what happens in a zone or region outage, the breaking point, the monthly cost, plain-language pros and cons, a Mermaid flowchart and a live link to the animated design.

users: client @nyc users=200k rpm=2
users -> cdn -> lb -> api -> redis [reads] -> postgres
api -> postgres [writes]

MCP server (Claude, ChatGPT, Cursor, VS Code, Windsurf and any other MCP client), free with no key:

Add to Cursor Install in VS Code

{ "mcpServers": { "querystorm": { "url": "https://querystorm.vercel.app/api/mcp" } } }

Claude Code: claude mcp add --transport http querystorm https://querystorm.vercel.app/api/mcp

Tools: simulate_design, compare_designs, design_language, example_designs.

HTTP API: GET /api/simulate?d=<design>&format=markdown, POST /api/compare with {"designs": [...]}, described in openapi.json.

A plain link, for assistants with no tools: querystorm.vercel.app/#d=users+->+lb+->+api+->+redis+->+postgres

In the app, the Use with AI button sets up any of these in a click or two, or opens Claude or ChatGPT with the current board already in the message. File → Copy as text for AI and Copy as flowchart go the other way. Setup for each client, the syntax and examples are in docs/AI.md and llms-full.txt.

Run it

npm install
npm run dev        # http://localhost:5173
npm test           # engine tests, including every challenge's reference solution
npm run lint       # ESLint
npm run build      # type-check and build into dist/
npm run e2e        # browser tests and accessibility checks against the build (Playwright)

Node 20 or newer.

Deploy your own

It is a static site plus three small serverless functions for the AI API (api/), with no database or keys.

Deploy with Vercel

  • Vercel: use the button, or import the repo. It detects Vite (npm run build, output dist). vercel.json already has the SPA rewrite.
  • Netlify, Cloudflare Pages, GitHub Pages: build command npm run build, publish directory dist. The build uses relative paths, so it works from a sub-folder.

After deploying your own copy, change the og:url, og:image and twitter:image addresses in index.html to your domain so link previews show the picture.

How it works

The simulation is a pure TypeScript engine in src/sim with no React in it. Each tick it pushes traffic from every group of users through the graph in order, works out each component's load, latency, failures and cost, and feeds retries back into the next tick. docs/ARCHITECTURE.md explains the model, its assumptions and where the numbers come from.

src/sim/          the engine: no UI, fully unit-tested
  engine.ts       traffic, latency, failures, autoscaling, cost, the 24-hour test
  analysis.ts     steady state, breaking point, growth plan, per-hop trace
  catalog.ts      the 29 components: cloud names, pricing, fields, trade-offs
  advisor.ts      recommendation rules and their fixes
  challenges.ts   the classic problems, plus the registry for custom ones
  problems.ts     more problems, written in the declarative challenge format
  problems2.ts    and more
  companies.ts    boards for the company case studies
  spec.ts         the challenge format: build, check, diff boards into steps
  regions.ts      regions, cities and distance-based latency
src/store.ts      app state, undo and redo, autosave, share links
src/share.ts      challenge links and result links
src/learn.ts      the lessons and course modules
src/library/      the company case studies: text, key numbers and sources
src/route.ts      the three pages: #/learn, #/library, #/lab
src/ai/           Querystorm text, reports, the HTTP API and the MCP server
api-src/          Vercel function entry points (bundled into api/ by npm run build)
src/ui/           board, 3D model, world map, panels

The numbers are teaching approximations, not a capacity plan: about 1 ms of round trip per 100 km, M/D/1-style queueing, tail latency combined along a path, list-price ballparks. They are all in engine.ts and catalog.ts if you want to argue with them, and docs/NUMBERS.md lists each one next to the published figure it is based on.

Designs as files

Every design is a small JSON document that you can export, import, keep in a repo or generate from a script. Share links carry the same JSON in the address. Challenges are JSON too, so a team can keep its interview problems in a repo. docs/FORMAT.md describes both, and tests keep the examples working.

Quality

Every push runs ESLint, the type checker, over 100 engine tests (every challenge's reference solution must pass its own targets, its starting board must not, and every challenge must survive a round trip through the editor) and 20 browser tests on desktop and phone sizes, including automated accessibility checks in both themes. Lighthouse on the production build scores 100 for accessibility, best practices and SEO, 100 for desktop performance and about 90 for mobile performance.

Contributing

New challenges, components, advisor rules and better numbers are all welcome. Start with CONTRIBUTING.md. A new challenge is one object in src/sim/problems.ts (or build it in the app under Library → Create a challenge and download the JSON), and the test suite automatically checks that its reference solution passes.

Licence

MIT

No installation packages available.