Course contentsShow
← System Design
Lesson 36 of 1,9191. System Design Mindset and First PrinciplesFree lesson

YAGNI: You Aren't Gonna Need It

Avoiding premature optimization and over-engineering by building only what's necessary now.

YAGNI: You Aren't Gonna Need It

What you'll learn: How to avoid wasting time and resources by building only what's actually needed right now.

The Core Idea

YAGNI stands for "You Aren't Gonna Need It" — a principle that reminds us to resist the temptation to add features, complexity, or infrastructure "just in case" we might need them later. In system design, this means focusing ruthlessly on solving the current requirements, not imagined future ones.

Think of it like packing for a weekend trip. You don't bring your entire wardrobe "just in case" you need a formal suit, winter coat, and snorkeling gear. You pack what you'll actually use based on where you're going and what you'll do.

Why YAGNI Matters

When designing systems, engineers often get excited about potential scenarios: "What if we need to support a billion users?" "What if we expand to 50 countries?" These questions lead to over-engineering — building complex solutions for problems that don't exist yet.

Over-engineering creates:

  • Wasted development time on unused features
  • Increased complexity that makes the system harder to maintain
  • Higher costs for infrastructure you don't need
  • Slower delivery of what users actually need now

Applying YAGNI in System Design

Remember our lesson on Start Simple: The Minimum Viable Design? YAGNI reinforces that approach. Design for your current requirements and constraints:

  • Supporting 10,000 users? Don't architect for 10 million yet
  • Need 99% availability? Don't build for 99.999%
  • Handling read-heavy traffic? Don't optimize for writes until needed

You can always Iterate Based on Constraints when the requirements actually change.

Key Takeaway: Build what you need now, not what you might need someday — premature optimization wastes resources and adds unnecessary complexity to your system.