Trust, but Verify the Bytes: Checksums and the Background Scrub
A store can do everything right — keep every acknowledged write, survive every crash, replicate faithfully — and still hand a client the wrong answer. Not because it lost the data, but because the bytes rotted after they were written. A disk flips a bit on a platter or in its own cache, an ECC memory module misses a multi-bit error, a firmware bug mangles a block, a marginal cable corrupts a transfer. The value read back is quietly not the value written, and nothing anywhere in the stack noticed, because every layer faithfully stored and returned exactly the bytes it was given — which happened to be wrong.
This is silent data corruption, and it is a genuinely different failure from the one durability protects against. Losing an acknowledged write is a failure you can detect: the key is simply gone. Corruption is worse because the key is still there, still readable, still passing every liveness check — it just contains garbage, and the system reports success the whole time. Replication does not save you on its own, either. If two replicas hold different bytes for a key and nothing can say which is correct, having two copies has only given you two answers and no way to choose.
The entire defense rests on one move: make corruption loud. If every value carries a small fingerprint computed from its contents, then a copy whose contents no longer match its fingerprint is provably bad — and a provably bad copy is one you can throw away and replace. That fingerprint is a checksum.
The checksum turns a wrong answer into a detectable error
At write time, the store computes a checksum — a short hash such as CRC32C — over the value's bytes and stores it alongside the value. On every read, it recomputes the checksum from the bytes it just loaded and compares it to the stored one. If they match, the bytes are almost certainly intact. If they differ, the value has been corrupted since it was written, and the read fails loudly instead of returning garbage. That single comparison is what converts silent corruption into an explicit, catchable error.
Where the checksum sits matters. Checksum per value and you catch corruption of any stored value on the next read of it. Checksum each page or block of the on-disk structure and you catch rot in the storage layout itself, not just the payloads. Checksum every record of the operation log and you catch a torn or corrupted write during recovery replay — which is exactly when you least want to faithfully re-apply a garbage mutation on top of good state.
// Write path: the fingerprint is computed from the bytes and stored with them.
record.Checksum = Crc32C.Compute(value); // cheap, hardware-accelerated
store.Put(key, value, record.Checksum);
// Read path: recompute and compare before trusting a single byte.
var (value, stored) = store.Get(key);
if (Crc32C.Compute(value) != stored) // the bytes changed under us
throw new CorruptionDetected(key); // loud, not a silent wrong answer
return value;
The best designs make the check end to end: the writer computes the checksum, it travels across the wire with the value, and the reader on the far node verifies it against the bytes it actually received. That catches corruption not only on one disk but in transit and in every buffer and copy in between — the checksum is validated at the two ends that matter, so no silently-faulty layer in the middle gets the benefit of the doubt.
Verifying on read is not enough — scrub the cold data
Checking the checksum on read catches corruption in data that gets read. The problem is the data that does not. Cold values — the long tail that is written once and rarely touched — can rot for months with no read to trip the check, and the corruption sits latent exactly where it is most dangerous: undiscovered until the day another replica fails and this quietly-bad copy is the one you reach for to rebuild. The moment you most need a correct copy is the moment you find out it was corrupt all along.
The answer is a background scrub: a continuous, low-priority sweep that reads every stored value, recomputes and verifies its checksum, and does so whether or not any client ever asks for it. The scrub turns corruption detection from reactive into proactive — rot is found while there is still a healthy replica to repair from, not after the last good copy is gone. It is the difference between discovering a bad copy on your schedule and discovering it on the failure's schedule.
Repair: the checksum finds the fault, the replica supplies the truth
Detection and repair are a division of labor. A failed checksum proves this copy is bad but says nothing about what the value should be — only that these bytes are not it. The correct value comes from a healthy replica, and the machinery to find and ship it is the same anti-entropy and read-repair already in the system: once the scrub flags a corrupt key, the node fetches the value from a replica whose checksum validates and overwrites the bad copy, exactly as a node rebuilding from its replicas pulls authoritative state. Checksums answer "which copy is wrong"; replicas answer "what is right." Neither is sufficient alone — a cluster with checksums but no replicas can detect corruption and do nothing about it, and a cluster with replicas but no checksums can hold the right answer and be unable to pick it out.
A note on the checksum itself: for catching random bit errors, a fast non-cryptographic checksum like CRC32C is the right tool — hardware-accelerated, a few nanoseconds per value, and statistically certain to catch the stray flipped bits that disks and memory actually produce. A cryptographic hash is overkill for corruption and only earns its cost when the threat is adversarial tampering rather than hardware fault, which is a security question, not an integrity one.
The dial: scrub speed against stolen I/O
The scrub competes with live traffic for exactly the disk and CPU the store needs to serve clients, so its rate is a genuine operational knob. Scrub the whole dataset quickly and you find rot sooner but steal bandwidth from the workload; scrub slowly and you barely touch live performance but widen the window in which a corrupt copy can go unnoticed. The sizing rule is the same shape as a snapshot cadence: pick a full-sweep period short enough that a latent corruption is very likely to be caught and repaired before a second fault could take out its last good replica, and throttle the scrub to fit inside the I/O headroom the workload leaves behind.
Wrap-up
Silent corruption is the failure that slips past durability: the data is present, readable, and wrong. A checksum stored with every value turns that silent wrong answer into a loud, provable error — recompute on read, verify end to end across the wire, and a mismatch is a copy you can discard. A background scrub extends the guarantee to cold data, finding rot proactively while a healthy replica is still around to heal it. Detection and repair split the work cleanly: the checksum says which copy is bad, the replicas say what is right. Tune the scrub to the I/O you can spare, and the store keeps not just all the bytes it was given, but the correct ones.