Skip to content
About
Main content

Where spill goes, and what that assumes

What breaks when the spill disk is remote, the node is elastic, or the data is regulated?

Every design in this article assumes fast local disk. There are four ways in which the surrounding assumptions break.

Disaggregation. On Kubernetes or in a cloud-native setup, "local disk" may be network-attached. That moves the r from about 50 to about 500. The formula of What spilling actually costs then gives, for 5% spilled: 0.95 + 2 × 0.05 × 500 = 0.95 + 50 = ~51×, instead of ~6×. The cliff is an order of magnitude steeper. The design is unchanged; its cost model is not. This is a case where a deployment decision silently invalidates an engine's tuning defaults.

Node affinity fights elasticity. Spill files live where the operator ran, so a node that holds spill state cannot be removed. An elastic worker becomes a stateful one while it spills. This puts spill in direct conflict with autoscaling. ( has the same problem, and dedicated shuffle services exist to solve it.)

Compression is free and should be automatic. LZ4-class compression codecs run at several GB/s per core, which is comfortably faster than the device they feed. The CPU doing the compression would otherwise be stalled waiting for I/O. When r is large, compressing spill divides the dominant term by the compression ratio at almost no cost. For example, with a 3:1 ratio, the 2·f·r term in the formula divides by 3. This is one of the rare decisions with no real trade-off, because the break-even is passed by an order of magnitude. The only reason to think about it is when the data is already compressed or encrypted upstream and will not compress again.

Encryption is a compliance question that lands here. Spill files contain user data, written to local disk. They are the most commonly overlooked place where production data comes to rest unencrypted. In a regulated environment, encrypting them is a hard requirement. It adds a second CPU pass on the same path, and unlike compression this is a real cost, because encryption does not reduce the number of bytes it protects.

One-line compression: spill assumes fast local disk and produces node-affine state, two assumptions that cloud deployment breaks in opposite directions.