BOOKS DEEP-READ · DDIA · CH 1

Reliable, Scalable, and Maintainable Applications

Designing Data-Intensive Applications · Ch 1 · Martin Kleppmann · 2017

中文 →

What is this chapter about?

Every app you use — a shop, a chat, a video site — runs on a system that stores and retrieves data. Chapter 1 of DDIA (Designing Data-Intensive Applications) doesn't teach any one technology. It asks a more basic question first: what makes a data system "good"? The author offers three yardsticks — reliable, scalable, maintainable — and the whole book revolves around them.

An analogy first

Think of a data system as a restaurant. Reliable: "even if a cook calls in sick or one stove breaks, guests still get fed." Scalable: "we handle 10 tables today and don't fall apart when we go viral and 100 turn up next month." Maintainable: "the kitchen flow is clean, so onboarding a new hire or adding a dish isn't a nightmare." This chapter turns those three fuzzy senses of "good" into things you can measure and argue about.

"Is the system fast?" is the wrong question

Most people measure speed by the average: 100 ms on average sounds fine. But averages lie — if 99 of 100 requests are quick and one stalls for 5 seconds, the average still looks great, yet the person waiting 5 seconds is often your most important customer (lots of data, heavy request).

This chapter teaches a better question: line up 100 requests fastest-to-slowest and look at the 50th, 95th, 99th. The 99th (called "p99") captures "the experience of the unluckiest slice" — and reputation usually rides on that, not the average.

It also separates "fault" from "failure"

A part breaking is a fault; the whole system going dark for users is a failure. The trick to a good system isn't "parts never break" (impossible) — it's making sure one broken part doesn't drag down the whole by keeping spares that take over. Netflix even keeps a "trouble monkey" (Chaos Monkey) that randomly kills live machines, forcing engineers to build systems where "losing one box is a non-event."

What does it give you?

After this chapter you hold a shared vocabulary for judgment: for reliability, talk about "keeping faults from becoming failures"; for speed, talk p95/p99 instead of averages; for scale, first ask "where exactly is the load growing?" Everything later — replication, partitioning, transactions — is really trade-offs among these three yardsticks. There's no best, only best-fit.

Remember this

Whether a data system is good comes down to three yardsticks: reliable (a broken part doesn't stop the whole), scalable (it copes when load grows), maintainable (easy to change and run). And stop fooling yourself with the "average" — watch the experience of "the slowest slice" (p99).

Want the mechanisms, notation and diagrams? → switch to Deep