DEV Community

Hamid
Hamid

Posted on

I Built a Distributed Systems Simulator So You Don't Need Cloud to Learn Infrastructure

๐Ÿš€ I Built a Distributed Systems Simulator So You Don't Need Cloud to Learn Infrastructure

Every tech company runs the same 6 layers:

๐ŸŒ Traffic Entry โ†’ Nginx, HAProxy, API Gateway
โš™๏ธ Orchestration โ†’ Kubernetes, Nomad
๐Ÿงฉ Service Mesh โ†’ Envoy, Istio
๐Ÿ—„๏ธ Data โ†’ PostgreSQL, Redis, MongoDB, Cassandra
๐Ÿ“จ Messaging โ†’ Kafka, RabbitMQ, NATS
๐Ÿ“Š Observability โ†’ Prometheus, Grafana, Jaeger

But learning these requires infrastructure. Multiple machines. Cloud accounts. Money.

I built DistSim to remove that barrier.

๐Ÿง  What It Does

DistSim runs on your laptop. Each "machine" is a real Ubuntu container. You get:

๐Ÿ–ฅ๏ธ Visual canvas to create and connect machines
๐Ÿ’ป Real terminals, SSH into any machine from your browser
๐Ÿ“ฆ 22 installable services from Nginx to Vault
๐Ÿง‘โ€๐Ÿ’ป Built in code editor for Go, Node.js, Python
๐Ÿ’ฅ Chaos engineering to inject failures and watch degradation
๐Ÿงช API tester to send requests and run load tests

DistSim workspace

๐Ÿ—๏ธ Example: Build a Load Balanced System

1๏ธโƒฃ Create a lab with the "Medium Company" template
2๏ธโƒฃ You get 1 load balancer, 3 app servers, database, Redis, 3 Kafka brokers
3๏ธโƒฃ Install Nginx on the LB and configure upstream round robin
4๏ธโƒฃ Write a Node.js API on each app server
5๏ธโƒฃ Set up PostgreSQL replication
6๏ธโƒฃ Send 1000 requests through the load balancer and watch distribution
7๏ธโƒฃ Kill one app server and Nginx routes around it
8๏ธโƒฃ Add 500ms delay to database and watch response times spike
9๏ธโƒฃ Add Redis caching and watch response times drop

All of this happens on localhost. No cloud. No cost.

โšก Install

git clone https://github.com/hamidlabs/distsim.git
cd distsim && bash install.sh
Enter fullscreen mode Exit fullscreen mode

Auto starts. Open http://localhost:3000

Manage:

distsim stop
distsim start
distsim status
distsim logs
Enter fullscreen mode Exit fullscreen mode

๐Ÿงฑ Tech Stack

๐ŸŸฆ Backend โ†’ Go, chi router, Docker Engine API
๐ŸŸช Frontend โ†’ Next.js, React Flow, xterm.js, Monaco Editor
๐ŸŸจ Containers โ†’ Docker, each machine is Ubuntu container
๐ŸŸฉ State โ†’ Zustand frontend, in memory backend

๐Ÿ”ฎ What's Next

๐Ÿ’พ Persistent sessions that survive restart
๐ŸŽฏ Guided challenges like payment service failure recovery
โ˜ธ๏ธ Kubernetes simulation mode
๐Ÿ‘ฅ Collaborative labs with teammates

โญ GitHub: https://github.com/hamidlabs/distsim ๐Ÿš€

If you are learning distributed systems, preparing for system design interviews, or teaching infrastructure, give it a try.
Stars and feedback welcome ๐Ÿ™Œ

Top comments (0)