Cloudflare’s authoritative DNS systems have to turn a customer's database edits into the records that servers can answer with. A change to an ordinary address record affects a much smaller piece of state than publishing a domain for the first time. Some configuration changes had still been triggering a rebuild of an entire zone. The cost grew with the number of records, and a slow job could leave later updates waiting for a message partition to advance. [1][2]

Cloudflare added more detail to the events that describe a change and classified which DNS output each change can affect. A planner could then rebuild the records for specific names, include shared metadata when necessary or rebuild only the zone apex and metadata for certain settings. Removing a zone used a separate purge operation. Events with unknown impact or changes that could affect the entire zone generally still called for a full rebuild. [1][2]

Cloudflare reported that peak aggregate working-set memory for its Zone Builder deployment fell from 79 GiB to 12 GiB. In a comparison using the same event stream, the largest spike in p99 build completion delay fell from 14.6 minutes to 1.21 minutes. Cloudflare attributed a separate improvement in median delay, from about 7.7 seconds to 3.3 seconds, to the new design and subsequent reductions in two timing safeguards. The 3.3-second result is not an isolated estimate of what the planner changed. [1][2]

Build completion here means that the builder finished writing its output. It does not measure when the new configuration reached every DNS server or when recursive resolvers stopped serving cached answers. Tom’s Hardware reported the engineering changes and company figures. The measurements are Cloudflare’s. [1][2]

Two architectural decisions reinforced each other. First, events carried enough detail to make the scope of a build an explicit choice. The planner could also reread current state before applying a plan, because the event stream and database replicas did not advance together. If the available replica was still behind the event, the builder rejected that read instead of generating new output from stale input. [1]

Second, a shared scheduler could combine several pending changes for the same zone. If one change affected an address and another affected a wildcard, the work list included both affected names and the necessary metadata. The scheduler kept the pending Kafka acknowledgments separate from the build plan. It could finish some work out of order without committing past unfinished work, preserving the option to replay after a restart. [1][2]

Analysis & application

Before introducing partial rebuilds, identify which output records each source change can invalidate. Include deletion, first publication, unknown events and shared keys in that inventory. Define how workers detect a stale source read. Then compare the partial and full outputs under the same source state and pin time-dependent values so the comparison detects a real difference. Cloudflare ran equivalence tests and compared targeted output during rollout. [1]

Add a separate plan for input too large for the baseline algorithm. Cloudflare describes an explicit threshold for very large zones where a full build cannot fit in memory. In those cases it rebuilds the apex, metadata and queued names, with an operational way to rebuild additional names. That exception requires its own correctness evidence and a way to recover rare situations. [1]

Cloudflare continued to use full builds for cases such as ordinary first publication and changes that could invalidate an entire zone. It also used a mirror that consumed production inputs and wrote to an isolated destination, allowing the team to compare output without serving mirror data to customers. The case offers a concrete standard for future work: measure build completion and resource use separately, and include persistent differences in generated records as a release criterion. [1]

FOLLOW THE EVIDENCE

The sources

  1. How we halved DNS build delay and cut memory use by 85% Cloudflare Engineering · blog.cloudflare.com ·
  2. Cloudflare engineers optimize DNS build services Tom’s Hardware · tomshardware.com ·