Datawrite amplification factor

Write amplification

Definition

Write amplification is the ratio between the work a system actually writes and the data the client asked to write.

In practice

Storage engines amplify writes in several ways: every secondary index needs updating, a B-tree page split rewrites whole pages, LSM compaction rewrites the same data several times, and the WAL adds a copy. At system level, fan-out on write turns one post into a write to every follower's timeline. Amplification decides disk wear, I/O capacity and write cost.

It is a trade, not a defect: extra work on writes often buys cheap reads, as with indexes and precomputed timelines. Measure it before optimising, drop unused indexes, prefer sequential keys, and cap fan-out for accounts with millions of followers by switching them to fan-out on read.

Example

A user with 2 million followers posts once, and fan-out on write turns that into 2 million timeline inserts; a table with 6 indexes turns each row insert into at least 7 page writes.