What is YAGNI? "You aren't gonna need it" in system design

YAGNI is a simple rule from software engineering: don't build things until you actually need them. Here is where it comes from, why over-engineering is so tempting in system design, and the few decisions you should still plan ahead for.

A small, busy tea stall selling chai, labelled customers today: 214, serving a customer. Next to it, the empty steel skeleton of a giant multi-storey food court with a crane and a sign reading coming soon: seating for 5,000, labelled customers today: 0.
Fig. 1 — Build the tea stall your customers need today, not the food court you imagine for next decade.

A friend opens a tea stall. Before selling a single cup, he wants to build a ten-storey food court with seating for 5,000, “because one day we’ll be huge”. It takes two years and all his savings. Meanwhile, the stall across the road started the same week with one kettle, learned what customers wanted, and now has three branches.

Software teams make the first friend’s mistake all the time. There’s a short rule to prevent it: YAGNI, “You Aren’t Gonna Need It.” This guide explains what YAGNI means, why it matters so much in system design, and where its limits are.

What is YAGNI?

YAGNI stands for “You Aren’t Gonna Need It”. It means: don’t build a feature, layer or capability until there’s a real, present need for it, not because you might need it someday.

The phrase comes from Extreme Programming (XP), an approach to software development shaped in the late 1990s by Kent Beck, Ron Jeffries and others. The original advice was about code: don’t add a setting, a hook or a general framework “just in case”. In system design, it applies to whole pieces of architecture.

What over-engineering looks like in system design

For a new product with a few thousand users, it’s common to see designs like this:

Two plans for the same new app with about 2,000 users. Plan A, built for imagined scale: 12 microservices, Kafka, a service mesh, a sharded database, three regions and Kubernetes; labelled months to build, many things to break, a large monthly bill. Plan B, built for today: one well-structured app, one Postgres database with backups, a cache, a CDN and a load balancer with two app servers; labelled weeks to build, easy to change. An arrow from plan B points to grow when the numbers say so: add replicas, split out a service, shard, each step triggered by a measured limit.
Same product, two starting points. Plan B can still grow into much of plan A, but one measured step at a time.
  • Many microservices for a team of four people.
  • Database sharding before a single database is even half full.
  • Multiple regions for an app whose users are all in one country.
  • A message broker like Kafka for a few events per minute.
  • A plugin system for features nobody has asked for.

Each of these is a real tool for real problems. Used too early, each one costs:

  • Time. Weeks or months spent on plumbing instead of the product users want.
  • Complexity. More parts means more ways to fail and more to learn for every new team member.
  • Money. Extra servers, extra regions, extra managed services every month.
  • Wrong guesses. You’ll guess wrong about where the scale problem appears. The hot spot might turn out to be search, not orders, and the effort went to the wrong place.

Why it’s so tempting

  • It feels responsible. “What if we go viral?” sounds like good planning.
  • Interviews reward big designs. System design interviews often ask for millions of users, so people carry that habit into real projects with hundreds.
  • It’s interesting. Building a distributed system is more exciting than adding an index to a table.
  • Copying big companies. Their architecture solves their problems at their size, and they didn’t start there either.

YAGNI doesn’t mean “don’t think ahead”

YAGNI is about not building early. It doesn’t mean ignoring the future. Good engineers still:

1. Plan for decisions that are hard to undo. Some choices are cheap to change later (adding a cache, adding app servers). Others are expensive: the main shape of your data, the ID format, which database family you use, or a public API contract that partners will build on. Spend your thinking time on those. A useful image: some decisions are two-way doors (walk back through any time) and some are one-way doors.

2. Keep the design easy to change. Clear module boundaries inside one app make it much easier to split out a service later, if it’s needed. Stateless app servers make X-axis scaling a configuration change instead of a rewrite.

3. Do the basics that are cheap now and painful later. Backups, monitoring, HTTPS, sensible database indexes and API versioning cost little at the start and a lot to retrofit. These aren’t YAGNI violations; you are going to need them.

4. Do rough numbers. A quick back-of-the-envelope estimate tells you whether “scale” is a real concern this year or a fantasy. Size for what the numbers say, with comfortable headroom.

YAGNI and its cousins

  • KISS (Keep It Simple): prefer the simplest design that works.
  • “Premature optimisation is the root of all evil”: a famous line popularised by Donald Knuth, warning against tuning for speed before you know where the slow part is. Measure first, then find the real bottleneck.
  • Evolutionary architecture: design systems to change in small, safe steps as needs become clear.

Common misconceptions

“YAGNI means writing sloppy code.” No. It means building less, not building badly. What you build should be clean and well tested.

“YAGNI means never planning for scale.” It means scaling in response to real signals, with a plan for how you’d do it, instead of building it all upfront.

“Big companies don’t follow YAGNI.” Most large systems started as much simpler ones and grew piece by piece as real limits appeared.

Key takeaways

  • YAGNI = “You Aren’t Gonna Need It”: build only what’s needed now.
  • It comes from Extreme Programming in the late 1990s.
  • In system design, it warns against microservices, sharding, multi-region and heavy tooling before the need is real.
  • Still think hard about hard-to-undo decisions, keep the design easy to change, and do the cheap basics.
  • Let measured numbers trigger each step of growth.

Frequently asked questions

What does YAGNI mean?

YAGNI stands for “You Aren’t Gonna Need It”. It’s a software principle that says you shouldn’t build features or infrastructure until you actually need them.

Who came up with YAGNI?

YAGNI comes from Extreme Programming, an agile software method developed in the late 1990s by Kent Beck, Ron Jeffries and others.

Is YAGNI bad for system design interviews?

Not at all. Interviewers like to hear you start with a simple design that meets the stated requirements, then explain how and when you would scale it. That shows judgment, not just knowledge of tools.

What is the difference between YAGNI and KISS?

KISS (Keep It Simple) says to choose the simplest design that works. YAGNI says not to build things before they’re needed. They support each other: building only what you need usually keeps things simple.

When should you ignore YAGNI?

When a decision is very expensive to change later, such as your core data model, public API contract or security basics. Think those through early, even if you don’t build every part of them yet.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.