DevTools Logo

Distributed Systems & Network Topology Simulator

About this tool

The Distributed Systems & Network Topology Simulator runs a tick-based, pure-TypeScript simulation of request traffic flowing through a topology you assemble from clients, load balancers, API gateways, microservices, message queues, distributed databases and caches — entirely in your browser, with no real network calls.

Each tick, client nodes originate requests that are routed through the graph: load balancers pick a downstream target (round robin, weighted, or least connections), API gateways and microservices gate traffic through a Hystrix/Resilience4j-style circuit breaker, queues buffer and drain messages at a configured rate, caches serve a TTL-decaying hit ratio, and databases model master-replica, quorum or Raft consensus topologies.

Chaos actions let you kill a node, partition it from the network, add packet loss (5-50%), inject a latency spike (500ms+), or force a circuit breaker open — then watch per-node status, latency and error-rate metrics react live on the graph and in the metrics tables below it.

Raft-backed databases expose a genuine split-brain lesson: quorumSize configured as a true majority of replicaCount makes split-brain structurally impossible even under a partition, while a misconfigured quorumSize lets two partition groups both elect a leader — the exact failure mode real Raft deployments are built to prevent.

Once you're happy with a topology, the Export tab generates a Docker Compose file, Kubernetes Deployment/Service manifests, and Mermaid or PlantUML architecture diagram code — starter scaffolding to sketch the shape of a real system, not a deploy-ready stack.

How to use this tool

  1. Load a topology

    Pick a preset — three-tier web app, event-driven pipeline, or Raft cluster — from the dropdown.

  2. Run the simulation

    Press Run to advance the simulation continuously, or Step to advance one tick at a time.

  3. Select a node

    Click any node on the graph to target it with chaos actions in the side panel.

  4. Inject chaos

    Kill or partition a node, add packet loss or a latency spike, or trip a circuit breaker, then watch the graph and metrics tables react.

  5. Read the metrics

    The Metrics tab lists per-node status, latency, error rate, plus circuit breaker phase and Raft leader/split-brain state.

  6. Export the topology

    Copy or download Docker Compose, Kubernetes manifests, Mermaid or PlantUML from the Export tab.

Use cases

Teaching quorum and split-brain risk

Show why quorumSize must be a strict majority of replicaCount, by contrasting a safe and an unsafe configuration side by side.

Explaining circuit breaker behavior

Demonstrate the closed → open → half-open → closed state machine without spinning up Hystrix or Resilience4j.

Sketching a topology before building it

Rough out a load balancer / gateway / service / cache / database shape and export a starter Docker Compose or Kubernetes manifest to iterate on.

Chaos engineering intuition

Explore how packet loss, latency spikes and node kills propagate through a request graph before running a real chaos experiment.

Common mistakes

Mistake:Treating the simulation as a real infrastructure test.

Fix:It's a client-side, educational model — see the warning banner. No real services, network calls or infrastructure are involved; use it to build intuition, not to validate a production design.

Mistake:Assuming any quorumSize prevents split-brain.

Fix:Only a quorumSize that is a strict majority of replicaCount (> replicaCount / 2) guarantees a partition can't elect two leaders — a quorumSize of half or less can split-brain.

Mistake:Expecting the exported manifests to be deploy-ready.

Fix:Docker Compose and Kubernetes exports are scaffolding with placeholder images and no resource limits, probes or secrets — a starting point to edit, not a finished deployment.

Frequently asked questions

Is this a real network simulation, or does it call any real services?

It's entirely client-side and educational. No real network calls, no real services, no real infrastructure — Raft leader election, split-brain and circuit-breaker behavior are simplified textbook state machines running in your browser.

Why didn't partitioning the Raft database cause split-brain?

The default Raft preset uses a quorumSize that's a true majority of replicaCount (3 of 5), which makes split-brain structurally impossible under a single partition — exactly what real Raft guarantees. Split-brain only appears if quorumSize is misconfigured to half or less of replicaCount.

What triggers a circuit breaker to open?

A microservice or API gateway node opens its breaker after a run of consecutive failures crosses a threshold. While open it fails fast without forwarding requests downstream, then allows one half-open trial request after a cooldown — success closes it again, failure reopens it.

How is latency calculated for a request?

Each node type adds its own latency: a fixed cost for load balancers/queues/caches, a load-scaled cost for microservices (base latency times a load factor that grows sharply above 90% CPU/memory), plus any active latency-spike chaos and the downstream path's own latency, accumulated bottom-up.

Can I use the exported Docker Compose or Kubernetes files directly?

Treat them as a starting scaffold, not a finished deployment. Image names are placeholders, and the Kubernetes manifests skip resource limits, health probes, secrets and persistent volume claims — edit them for your real stack.

Does anything I build here leave my browser?

No. The topology, the simulation state and every export are generated and rendered entirely client-side.

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML