Definition · Write-through and write-backUnder write-through, every write is applied to the cache and to the backend before it is acknowledged. Under write-back, a write is applied to the cache, marked dirty and acknowledged; dirty entries are written to the backend on a periodic flush.
The coalescing ratio of a trace under write-back is the number of writes divided by the number of distinct keys written, counted per flush window. It is 1 when every write in a window is to a different key, and it is the window length when they are all to the same key.
Both policies leave the cache correct. The difference is entirely about the backend: how many writes it receives, how quickly it learns about them, and what happens to the ones it has not learned about yet.
Counting the ratio off a trace
Take the write trace A B A C A B A D A B and flush every five writes. The first window is A B A C A: five writes, three distinct keys, so two writes to A are coalesced away. The second is B A D A B: five writes, three distinct keys again. Ten writes, six backend writes, a ratio of 5/3.
trace: A B A C A | B A D A B flush every 5 writes
window 1 A B A C A 5 writes → 3 distinct {A, B, C}
window 2 B A D A B 5 writes → 3 distinct {A, B, D}
write-through 10 backend writes at 1 000 w/s → 1 000 w/s
write-back 6 backend writes at 1 000 w/s → 600 w/s
ratio 10/6 = 5/3
largest dirty set: 3 keys × 4 kB = 12.00 kB, held for 5.0 ms
Widen the flush window to ten writes and the whole trace becomes one window: four distinct keys, a ratio of 5/2, and the backend sees 400 writes a second instead of 600. The dirty set grows to 4 keys and 16.00 kB, held for 10.0 ms. That is the trade in its entirety, and both ends of it moved together.
What the trace decides
The ratio is a property of the workload, not of the policy. A trace in which every write is to a different key inside its window — A B C D E F G H I J — coalesces nothing at all: write-back sends ten writes, exactly as write-through does, and still carries the loss window. A trace of one key repeated ten times coalesces to one per window and buys a ratio of five.
So “write-back is faster” is not a general claim. It is a claim about a workload with repeated writes to the same keys inside a flush interval, and if you do not have that, write-back is a loss window with no compensating gain. Run your own trace before choosing.
What is actually at risk
The bytes at risk are the largest dirty set times the object size, and the exposure lasts a flush interval — w/λ_w seconds, for a window of w writes at λ_w writes a second. At 1 000 writes a second and a five-write window that is 5.0 ms, which sounds negligible until you multiply it by the number of processes you run and the number of times a year each of them dies.
The honest statement of the trade is arithmetic on both numbers at once: a flush window k times wider improves the ratio by at most k and grows both the dirty set and the exposure time. Whether the trade is acceptable is a durability question, and Availability and Failure is where losing things gets priced.