Module 1 / What is system design? / Everything is a tradeoff

Lesson8 minModule 1 · lesson 4 of 9

Everything is a tradeoff

Every choice gives something up.

Caching makes reads fast but can show old data. More servers survive failures but cost more and are harder to run. There is no free option, only choices whose costs you accept. A designer is less a person who knows the best answer and more a person who can name what each answer costs.

SpeedCostFreshnessmore speedcosts morecaching risksstale data
Choosing one thing moves you away from another.

Consider a restaurant menu page in a delivery app. If every view hits the database, the menu is always current but the database does a lot of work. If you store a copy in a cache for five minutes, the page loads far faster and the database relaxes, but a dish that just sold out can still show as available for up to five minutes. Neither is right in general. A menu can tolerate five minutes of staleness; an account balance usually cannot.

Make a choice on purpose

Step 1 of 4

Name the options

Write down at least two real alternatives, including doing nothing.

Tradeoffs also have a time dimension. A choice that is right at 1,000 users can be wrong at 1,000,000, and the reverse: the clever setup built for a million users that never arrive just burns money. Good designers pick the option that fits the next order of magnitude, and leave room to change.

Your turn

Your team can store photos in the main database or in separate file storage. List one benefit and one cost of each.

Stuck? Think about price, speed, and how much work the database does.

Question 1

A team adds a cache to speed up reads. What is the most direct tradeoff they accepted?

Question 2

Why write down the reasoning behind a design decision?

What to remember

  1. Every choice gives something up.

  2. Name options and their costs before choosing.

  3. Justify decisions against constraints and time.

  4. Write the reasoning down, including what would change your mind.