Skip to main content
Jimmy Jansen

Simplicity Is an Architectural Decision

I want systems that are easy to understand and change. Getting there means deciding which complexity the problem needs and where it belongs.

I spend a lot of time working in codebases I didn’t write. Before I can change anything, I need to understand how it behaves. That gets difficult when following a feature means working through layers of abstractions before I reach the code that does the work.

Link to section: What an abstraction makes you learnWhat an abstraction makes you learn

I like abstractions when they let me understand one part of a system without having to learn all of its internals. A good boundary tells me which details I can leave alone until I need them.

That benefit gets lost when the abstraction needs more explanation than the behaviour behind it. A small piece of logic ends up wrapped in configuration and base classes because we might want to reuse it later. Now I have to understand how all of that fits together before I can make a change.

The extra structure might be useful eventually. Until then, every engineer working in that code pays for it. Debugging takes longer because we have to work out whether a problem comes from the application or the machinery around it. Changes feel riskier when it’s hard to see what else depends on that machinery.

I would rather leave straightforward code in place until there’s a reason to organise it differently. Before adding an abstraction, I want to be able to explain what it makes easier for someone working in the code today.

Link to section: When duplicated code becomes a problemWhen duplicated code becomes a problem

I don’t mind seeing a few duplicated lines. Two parts of a codebase can filter an array the same way without needing a shared function. Those pieces might change independently, and keeping them separate makes that easy.

A permission rule copied into three places is a different problem. When that rule changes, all three copies need to change with it. Miss one, and different parts of the system start making different decisions about what a user is allowed to do.

If the copies can safely behave differently, I’m usually fine leaving them alone. If they represent the same rule and have to stay in sync, that rule needs one place to live.

Link to section: How much of the future to build forHow much of the future to build for

Architecture involves making guesses. We have to think about growth and decisions that could be expensive to reverse. I just don’t think every possible future deserves an implementation today.

We might need to migrate later or handle more traffic. Before building around either possibility, I want to understand how likely it is and what it would cost to deal with it later. Preparing now can be sensible when waiting would leave us with an expensive change. But somebody has to build and maintain that preparation even if we never need it.

Past experience can make this difficult to judge. After a painful migration, it’s easy to want every system to be ready for the next one. The same thing happens with a design that worked well. We carry it into another project because we already know how to build it, without checking whether the reasons for using it still apply.

A previous project’s constraints shouldn’t quietly become this project’s requirements.

Link to section: When more structure helpsWhen more structure helps

Sometimes the complexity is already there, and the system needs more structure to handle it.

In one service, a request could trigger a large amount of downstream work. The initial design handled that work directly and synchronously. It was straightforward to follow, but under realistic testing the service was effectively DDoSing itself.

That design needed a queue to manage the work, even though it meant another component to operate. Caching avoided repeated processing, and bulk endpoints let callers request a whole operation instead of flooding the service with smaller calls.

I don’t expect a design to stay right forever. After working with it, we may find that an abstraction gets in the way or that we need a boundary we left out. I want us to be able to make that change without having to untangle the rest of the system first.