Book Deep Read · Chaos Engineering · Chapter 19

Chaos Engineering on a Database

Chaos Engineering: System Resiliency in Practice · Ch 19 · Chaos Engineering on a Database · 2020

中文 →

What is this chapter about?

When you move money in a banking app, it leaves one account and shows up in another. The database behind it must never "take the money and forget to deliver it." Big modern databases are rarely one machine; they are dozens or hundreds of machines working together. This chapter is a first-hand report from a company that builds one (PingCAP, maker of TiDB): how they deliberately torture their own database to make sure it still never loses data or miscounts, even when things break.

A strange fact first

You'd think: once all the tests are written and passing, the database is safe to ship. But the nastiest bugs in a distributed database live on paths no test ever walks, like one machine losing power halfway through a write at the exact moment the cable between two others flickers. Each failure alone is handled fine; together they break things. With hundreds of machines running every day, that kind of coincidence eventually happens.

Why the old world struggled

How it works, intuitively

What it buys you / how to choose

The payoff: coincidences that might happen "once in a blue moon" in real life get hit several times a day in testing, so bugs are caught before users meet them. One honest cost: this kind of shaking can only prove "we found a bug," never "there are no bugs left," and building and running a simulator around the clock takes real people and machines.

Remember it in one line

Database bugs are quiet, so keep causing accidents on purpose while auditing against rules like "the total can never change."

Want to see where faults land in TiDB's architecture, how the four injection layers work, why the bank test catches consistency bugs, and where the Schrodinger platform and Chaos Mesh came from? → Switch to Deep