When Your Laptop Isn't Enough
Even with caching, some build actions are unavoidable — either because the code genuinely changed, or because it is a first build. A 16-core developer laptop can run 16 compilation actions in parallel. A large C++ binary might require compiling thousands of translation units. Running that sequentially or even with 16-way parallelism could take an hour.
Remote Execution (RE) solves this by turning your local build tool into a dispatcher. Instead of running compiler commands locally, the tool:
- Packages up the inputs for each build action (which it knows precisely, thanks to hermeticity).
- Sends those inputs to a Remote Execution Service — a build farm with potentially thousands of CPU cores.
- The farm executes the actions in massively parallel fashion.
- Results are streamed back to your local machine.
Your laptop's role is reduced to coordination: hashing inputs, dispatching actions, and assembling the final output. The heavy computation happens in the cloud.
Remote Execution + Remote Caching Together
Remote execution and remote caching are complementary and typically deployed together. The RE service populates the remote cache as a side effect of running build actions. This means:
- The first build (cache cold) is fast because it runs on thousands of cores in parallel.
- Every subsequent build (cache warm) is faster still because most actions are cache hits and require no computation at all.
The Remote Execution API (REAPI) is an open protocol (originally developed by Google for Bazel) that defines the interface between a build tool and a remote execution backend. Multiple open-source backends implement it, including BuildBuddy, EngFlow, and Buildbarn, allowing teams to self-host or use managed services.
The Practical Impact
At Google's scale, Bazel with remote execution and caching means that a developer can check out the entire monorepo and run a build of a complex service in under a minute — even though a cold build of that service from scratch would take hours. The system achieves this by combining three properties: hermetic inputs (so caching is safe), a fine-grained dependency graph (so only affected targets are rebuilt), and remote execution (so unavoidable work is parallelized across thousands of cores).