Aditya Dutt Pandey

Builds · 2025

Published · 4 min read

I keep building worse versions of software that already exists

Redis in Go, a load balancer in Bun, a gRPC mesh, an SFU, a small OS in C. None of them will replace the original, and they're not meant to. What I rebuild, what I don't, and how it changes the way I run tunyt's stack.

I've spent weeks building worse versions of software that already exists, on purpose: a Redis-compatible server in Go, a load balancer in Bun, a four-service gRPC mesh, an SFU on mediasoup and a small operating system in C.

None of them will replace the original. If you're running production on my Redis, please stop. But each one changed how I make decisions as a CTO.

I rebuild what holds my system up

I don't pick these at random. If a tool is load-bearing for what I run, I want to understand it from the inside.

Every convenience is rent. What I can't rebuild owns me.

I still use tools. I run Kafka, Redis and Kubernetes in production and wrote none of them. I want to know them well enough to answer three questions: what does it cost, where does it break, and what will I do when it does?

Redis taught me about TCP

Redis speaks a protocol called RESP, and it's simple. A line starting with + is a string, - is an error, : is an integer, $ is a blob of bytes with its length up front, and * is an array.

*3\r\n$3\r\nSET\r\n$3\r\nkey\r\n$5\r\nvalue\r\n

That's SET key value. My version speaks it well enough that redis-cli connects and doesn't notice. I wrote the parser, the storage and the command handling by hand.

The first lesson was about TCP. TCP gives you a stream of bytes. One command can arrive in two pieces, or three commands can arrive glued together in one read. Your parser has to handle both, or it works on your laptop and breaks under load. A whole class of "works locally, fails in production" bugs made sense after that.

The second: real Redis runs commands one at a time on a single thread. Once you write the command loop yourself, that looks like a feature. No locks around the data, no races between commands, very predictable latency.

The load balancer taught me what "healthy" means

When you configure a load balancer you tick "health check" and move on. When you build one, you have to decide what healthy means. Is a server that answers /health instantly but takes four seconds on real requests healthy? How many failures before you stop sending it traffic? How do you bring it back without stampeding it?

Mine does auto-scaling for Bun backends, active health checks, routing and live monitoring. It taught me more about connection handling than a year of configuring someone else's.

The SFU taught me why video calls need a middleman

In a naive group call everyone sends their video to everyone else. That's a mesh. With five people, each one uploads four copies of their video. Home internet is much worse at uploading than downloading, so the mesh falls over long before you'd expect.

An SFU (selective forwarding unit) fixes it. Everyone uploads once, to the server, and the server forwards streams to everyone else. Build the mesh, watch it struggle, and you see why every serious video product works this way.

I stop at small

I never try to finish these. A small version teaches the shape of the thing, and the last 10% of a database is years of other people's work.

That has a cost. A small version skips the hard parts: replication, persistence, failure handling at scale. When I say I understand Redis, I mean I understand why it's shaped this way. I couldn't run it better than the people who maintain it.

It changes real choices

When we choose infrastructure for tunyt, I'm choosing from a picture of how the thing works inside, and a feature table is only part of it. When someone proposes a new moving part, my first question is what it costs per instance and where it breaks. I've built enough small versions to know every moving part has an answer to both.

The rest of the set:

  • go-grpc-micro. Account, catalog and order services over gRPC behind a GraphQL gateway, on PostgreSQL and Elasticsearch. Small enough to hold in your head, real enough to break.
  • cqrs. The read/write split Tixin ran on, in its own repo. I could pull it out cleanly because I'd built the pieces underneath.
  • OsU. A small operating system written from scratch in C.

I build these so the software I depend on stops being a black box.

By , CTO of tunyt

← All writing