Borrowing someone else's architecture, and inheriting their complexity

Back in 2025, I was implementing a backend that manages compute and container resources, a bit like Kubernetes does. So I thought: Kubernetes is battle-tested and maintained by some of the best engineers in the world, so why don’t I go study their code and architecture, and copy it for myself? Surely then my app would be sorted.

I shipped it to production. But the service took longer to release, and every feature after that became a research question about how Kubernetes would do it, instead of how I would.

What I copied

Looking back, I copied pretty much their whole API machinery: a hub-and-spoke versioning registry (an internal version and external versions of the same objects), a code generator for the conversion boilerplate between those versions, and the codecs for encoding and decoding them. On top of that sat a Kubernetes-style API server and controllers.

To give a sense of how ridiculous it got, around 60% of the code was Kubernetes-inspired machinery and glue, not actual business logic.

What it costs

To be fair, the service was a public API that customers could use. But it barely had any usage. And I optimised for backwards compatibility and API versioning, instead of optimising for delivery speed. I thought customers would appreciate us for being careful about breaking changes.

In reality, the product was moving so fast that almost every release broke something anyway. Under time pressure, I ended up manually writing the object changes into the database, and working around the very API machinery that was built to prevent that.

Then, for every new feature, my first instinct was to go look for a similar concept in their codebase. If a feature didn’t fit, I’d force it into their shape, and sometimes I even turned down requirements just to keep the design pure. I also pushed that design onto teammates who needed to contribute to the service. They’d make mistakes, and I’d spend time fixing them. Most of the time, the mistakes came from the confusion of the machinery, not the implementation of the features themselves.

Why it didn’t work

What I failed to realise was that every complex architecture has its reasons to be complex, and it takes time to get there. Kubernetes needs versioning because thousands of clients, tools and deployments depend on its API. At that scale, breaking changes hurt real production workloads, and the API machinery is their solution. Even then, their codebase evolved over years. When I looked back past commits, the complexity was much lower in their early days. The team didn’t come up with the code and architecture I see today for the sake of it; they solved real pain.

We were the opposite. We were a small team building a small product for a small customer base, still trying to validate the idea, so the priority was getting features out as quickly as possible. And we had something Kubernetes doesn’t: the freedom to break things. I should have taken advantage of it whilst I still could.

What did work

Studying the Kubernetes codebase wasn’t a complete waste of time, though. Their controllers are level-triggered: instead of reacting to individual events, each one keeps comparing the desired state with the actual state and works to close the gap. If I hadn’t studied Kubernetes, I’d probably have built edge-triggered controllers that react to events, and wandered into the world of message queues. Instead, I learnt to use the database as the queue, and avoided everything that comes with an event-driven design: missed or out-of-order events, the database and queue drifting out of sync, extra infrastructure to run, and so on.

My own takeaways

The Kubernetes engineers are obviously very good, and their architecture, hardened by years of production use, is worth studying. But whether copying it would work came down to one thing: were we solving the same problems? Same problem, and their solution fits. Different problems or constraints, and you’re painting yourself into a corner.

I still reach for an established codebase when I start something new. The difference is that I try to look at them as references rather than diving head first into copying the code and architecture. I stop and ask what problem it was built to solve, how its authors got there, and whether I actually have that problem yet.

cd ..