Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

Design a 100k Actions/min Distributed Remote
Build Cache & Execution Platform.

Design a Bazel/BuildBuddy-scale remote build cache and execution platform sustaining 100k+ actions/min, >92% AC hit rate, singleflight coalescing, and Lazy FUSE worker mounting.
Start the journey2 stages· Last modified Dec 3, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When scaling remote build execution, coalesce identical Action Digests and mount inputs lazily over FUSE.

TL;DR30-second simplified summary
▾

Cuts input bandwidth 88% and achieves >92% cache hit rates.

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
Content-Addressed Storage (CAS)
Immutable SHA-256 blob storage.
Singleflight Coalescing
Deduplicates concurrent identical requests into one execution.
Full walkthrough · 2 stages
01
STAGE 01intermediate

Singleflight Coalescing & Lazy FUSE Mounting.

Why this matters: Eliminate duplicate CI work and 88% wasted input downloads.

Scheduler coalesces concurrent requests for the same ActionDigest; workers mount virtual Merkle trees via FUSE and pull only read() pages from local NVMe CAS.

Bazel ClientAction Cache / CASSingleflight SchedMicroVM + Lazy FUSELookup digestCache missCoalesced exec
ChoiceWhat it buysWhat it costs
Eager Full Tree DownloadSimple workerDownloads 500 MB when only 60 MB is read
Lazy FUSE + NVMe CASSub-second start; 88% bandwidth savedRequires FUSE daemon on worker
class SingleflightScheduler:
    def __init__(self):
        self.inflight = {}

    def submit(self, action_digest: str, dispatch_fn):
        if action_digest in self.inflight:
            return self.inflight[action_digest]  # Coalesce duplicate CI action
        fut = dispatch_fn(action_digest)
        self.inflight[action_digest] = fut
        return fut
02
STAGE 02advanced

Zstd ByteStream & Hermetic Execution Trace.

Why this matters: Stream compressed artifacts deterministically.

Outputs are compressed with Zstd-3 (2.8x ratio) and streamed via multiplexed gRPC ByteStream.

CI ClientAC & SingleflightFUSE MicroVM1. 2ms: Query Action Cache bySHA-256 digest2. Coalesce 50 misses -> 1hermetic worker3. Stream Zstd outputs viaByteStream
Engineering Decision Framework
Problem
How to mount 500 MB input Merkle trees onto thousands of ephemeral MicroVM workers without saturating cluster NICs.
Naive Solution
Eagerly download and extract every file in the input Merkle tree onto worker disk before starting the compiler.
Why It Fails
Compilers typically read only ~12% of declared header/dependency trees; eager downloads waste 88% of NIC bandwidth and add 5–15s cold-start delay.
Alternatives
Eager full-tree download, shared NFS mount (no hermetic isolation), or Lazy FUSE + node-local NVMe CAS.
Engineering Decision
Mount the input Merkle tree via Lazy FUSE backed by a shared node-local NVMe CAS cache, fetching missing blobs on first read().
Trade-Offs
Adds minor FUSE syscall overhead on first file open, but cuts network transfer 88% and starts workers in <200 ms.
Decision Exercise · Make the Call

50 CI jobs simultaneously trigger the exact same uncached test action with a 500 MB input tree. How do you minimize both compute and network load?

public boolean canCoalesce(boolean isHermetic, String digest) {
    return isHermetic && digest != null && !digest.isEmpty();
}
Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why does Lazy FUSE cut remote worker network transfer by ~88%?

Recommended Learning Flow