Cloudflare Grew a DNS Rebuild Into Five Build Types
Cloudflare's Zone Builder now plans the smallest DNS build it can prove safe: five build types, one unified scheduler, and a measured 85% cut in peak memory.
TL;DR
- Cloudflare's DNS Zone Builder is the service that turns a DNS record or zone setting change into the keys its authoritative DNS servers read from Quicksilver, Cloudflare's distributed key-value store.
- On 2 November 2026 Cloudflare published the redesign it now runs: a targeted build planner that picks the smallest build the team can prove safe, and a unified scheduler that merges work for one zone. Zone setting changes stopped rebuilding zones that hold tens of millions of records.
- The planner chooses among five build types. Over 24 hours, 86.81% of builds touched only the named records, 2.54% rebuilt records plus shared metadata, 2.30% rebuilt the apex plus metadata, 1.30% were purges, and 7.04% were full zone rebuilds. Together, 92.95% of builds avoided rebuilding the complete zone.
- Peak memory for the Zone Builder dropped from 79 GiB to 12 GiB, and aggregate working-set memory from an average of 49 GiB to 7 GiB.
- Uncertainty still escalates: a timestamp-only database update, an unknown event, or a change that can affect records anywhere in the zone keeps its full rebuild.
- Release safety rests on equivalence tests that compare every key against a full build, and on a mirror Zone Builder that consumes production Kafka, writes to a separate Quicksilver and is compared on a 20% sample of zones.
- The result shows up in the tail: the largest p99 build completion delay fell from 14.6 minutes to 1.21 minutes, and the median fell from about 7.7 seconds to about 3.3 seconds after the scheduler release.
- Two limits stay open in the post: the p99 figure is aggregated across build types and plans, so it describes the fleet, and the largest zones gain their speed by rebuilding the apex, the metadata and the named records, which keeps the complete-zone path out of their queue.

A zone change becomes a Quicksilver key
A DNS zone holds the records and settings for one domain, and Cloudflare moves a change to that zone through several stages. A customer edits a record in the dashboard or through the DNS Records API, another product changes a zone setting, the change lands in a database, and a Kafka event carries it to the DNS Kafka Aggregator. The aggregator merges events from several topics and hands them to the Zone Builder, which reads the zone data, converts it into the key layout the authoritative servers understand, and compares those keys against Quicksilver. Quicksilver carries the difference across the network.
Each of those events starts a clock. Cloudflare measures the interval from a change to the moment the change exists in the data its authoritative servers can use, and it calls the work in between a build. The 2022 version of the pipeline handled about 250 record changes per second. The service now handles about 700, plus about 100 other events such as zone setting changes.
The event rate describes growth. The hard part sits in the shape of the work that certain events demand. A full build reads the zone and its settings, reads every record, encodes every record into keys, compares the whole set with what Quicksilver holds, and then writes only what changed. The write is small; the preparation is the entire zone, held in memory. That is fine at ten thousand records and impossible at tens of millions, and Cloudflare says some zones already pass 20 million records with growth toward hundreds of millions.

The planner answers three questions before it picks a build
Targeting a build means answering which DNS names can change, whether shared metadata or the published-zone list can change, and which previous state has to disappear from Quicksilver. Zone settings make the middle question harder than it sounds. Universal SSL is Cloudflare's own example: switching it on or off updates metadata and can change the Certification Authority Authorization records at the zone apex, so a setting change reaches records that the setting never names.
The planner works from a distinction inside Quicksilver output. Record keys carry the answers for one zone and one name. A smaller metadata key tells the authoritative servers how to use the zone, including where special records such as nameservers and wildcards live. Some events touch only record keys; others have to update both. From that distinction comes a menu of five build types: resources only for ordinary A, AAAA, TXT and CNAME changes; resources and metadata for nameserver and wildcard changes; apex and metadata for settings such as Universal SSL; a purge when a zone stops being published; and the full zone build for everything the planner cannot bound.
The rule that keeps this honest is stated once in the post and repeated throughout the implementation: every key a targeted build writes has to be byte-for-byte identical to what a full build would have written. Where the team cannot show that, the build escalates.

Timestamp-only events keep their full rebuild
Some database functions update a timestamp and nothing else, which in effect says that something about the zone changed. Sometimes that is bookkeeping. Sometimes it means data moved somewhere else and has to be read again, and the event looks the same either way. Until Cloudflare can identify the caller and its purpose, a timestamp-only update still causes a full build. The same treatment applies to missing details, unknown events, and any change that may touch records anywhere in the zone.
One deliberate exception runs the other direction. A full build holds every record and every existing Quicksilver key for the zone in memory at once, and the largest zones do not fit. Above a fixed record-count threshold, the Zone Builder never escalates to a full build: it rebuilds the apex, the metadata, and every name named by the queued events. Cloudflare accepts that trade because a full build of those zones cannot finish, and while it retries it holds back every other change on its Kafka partition.
One metadata key serves every zone on a domain
Quicksilver keeps each zone's record keys separately, and then keeps a single metadata key shared by every Cloudflare zone with that domain name. That shared key behaves like a directory: it tells the authoritative servers which internal zone IDs may answer a query. Several zone objects can exist for one public domain during onboarding, offboarding and other lifecycle changes, and a priority policy selects the small set that gets published.

The consequence is a second planning constraint. A TXT change at a subdomain inside one zone object touches only that object's record keys. A nameserver or wildcard change also touches the shared metadata key, which describes every zone on the name. At execution time the Zone Builder reads the current list again, rebuilds the whole metadata key from that fresh view, and writes the triggering zone's records before the metadata that refers to them.
Planning runs twice, and the second read decides
An event describes the past. A build may wait while more events arrive and the database moves on, so the planner produces a conservative work list from the event and then, immediately before writing, reads a fresh publication snapshot: current zone settings, whether this deployment should publish the zone to its network, and which same-name zone IDs belong in the metadata key. A network here is a separate, isolated copy of Quicksilver for one environment, so a zone can be live on the global network and on the China Network with different answers.
Four outcomes follow from that second read. A targeted build can become a full build when the zone now carries a feature that needs complete-zone work. A build can become a purge when the zone should leave this network. A build can be skipped when the triggering zone no longer belongs in the metadata key. A metadata build can be reconstructed from the current candidate set.

The fresh read comes from read-only database replicas, which keeps builds off the customer write path and creates a lag problem. Kafka delivery and database replication move independently, so an event can arrive before its change is visible on a replica. The aggregator holds events long enough to cover normal lag, and a final database check rejects a read when that replica is still behind.
One scheduler merges what two queues used to hold
Record work and full-zone work used to sit in different schedulers, and each could merge its own work while the other's sat in a separate queue. Cloudflare replaced both with one scheduler: the planner decides what must be built, and the scheduler decides when it can run. When several events for a zone arrive before a build starts, their requirements combine, and merging only adds work. If any event needs the complete zone, the merged build becomes a full build. A purge overrides every rebuild, because its desired result is that the zone stops being published.
The scheduler tracks two things separately: the DNS work to perform and the Kafka messages waiting to be acknowledged. A retry preserves both. Even when a full build or a purge no longer needs the individual names, the messages stay attached until the result is safely written.
Soft committing keeps one slow build from stalling its partition
Kafka divides messages into ordered partitions and stores one committed offset per partition, the point before which every message is known complete. Moving that offset past unfinished work would lose a customer change after a restart. Cloudflare uses soft committing: a build can finish out of order and be marked complete in memory, while the committed position advances only after every earlier message has also finished.

The design chooses repeated work over lost changes, and the post says so directly. Targeted plans shorten how long the oldest message stays unfinished, and the scheduler also stops one busy zone from taking every worker: after a zone builds, its next build waits for a per-zone rebuild interval that differs by plan, and changes arriving in that window merge into the next build.
Equivalence tests and a mirror gate every release
A smaller build earns its place by producing the same DNS data. Cloudflare added equivalence tests for the nameserver, wildcard and apex paths: each test runs a full build and a targeted build from the same database state, pins time-dependent values, and compares every Quicksilver key owned by the targeted plan byte for byte. Planner and scheduler tests cover classification, same-name zones, merging, purges and escalation.
Tests cannot reproduce every customer combination, so every release also runs through a mirror Zone Builder. The mirror consumes the production Kafka stream and reads production database state, then writes to a separate Quicksilver environment that serves no customer traffic. A comparer checks a 20% sample of zones for missing keys, extra keys and different values.
Timing differences are expected, because the two environments do not build a zone at the same instant. What the team watches is new kinds of difference that survive both pipelines catching up. The dashboard that groups them runs on Cloudflare's own developer platform: a Worker receives results, Durable Objects keep state, and Cloudflare Access protects the page.

What the measured distribution shows
Across 24 hours, 86.81% of builds were resources only, 2.54% were resources and metadata, 2.30% were apex and metadata, 1.30% were purges, and 7.04% were full builds. The two metadata build types used to be full builds even for large zones, so combining them with the surviving 7.04% gives 11.88%, and Cloudflare reports full builds falling by about 40%. The count understates the work avoided, because the events that used to trigger the biggest rebuilds sat in those two categories.
The builds that remain full average 0.35 seconds, which fits Cloudflare's explanation that they come from events such as first publication, where the zone is new and small. The post also retires a 2022 plan for a batching system: the unified scheduler merges events only when work is already queued for the same zone, and with fewer long full builds the pipeline now consumes Kafka at the rate events arrive.
Memory tells the same story from the other side. Aggregate working-set memory fell from an average of 49 GiB to 7 GiB, an 86% reduction, and peaks fell from 79 GiB to 12 GiB, an 85% reduction. The headroom then paid for itself twice: Cloudflare shortened the per-zone rebuild interval on most plans, and shortened how long the aggregator holds each event for replica lag once the databases began rejecting reads from stale replicas.

What the numbers leave open
For anyone running an equivalent pipeline, the transferable idea is the escalation rule. A planner that guesses when a smaller build is safe is a machine for producing stale DNS data, and the only way to keep it is to make the safe case provable and send everything else down the expensive path. Cloudflare states the same rule about uncertainty inside the planner: it never turns uncertainty into less work.
The second transferable piece is the comparison environment. A mirror that reads production state and writes nowhere a customer can see turns a risky rollout into a measured one, and the numbers in the post come from exactly that arrangement: two pipelines fed by the same production events. Teams that run their own sovereign infrastructure and cloud exit work meet the same shape of problem when a configuration change has to reach many nodes at once, and the mirror comparison is the part worth copying first.
Two questions stay open in the post. The p99 figure is aggregated across build types and customer plans, so it describes the fleet and gives no guarantee for one zone. And the largest zones now avoid full builds by rebuilding apex, metadata and the named records instead, which means the correctness argument for those zones rests on the equivalence tests for those three paths and on manual rebuilds for rare cases such as enabling a zone on another network.
Sources
Source: How we halved DNS build delay and cut memory use by 85% — blog.cloudflare.com, 2026-11-02, https://blog.cloudflare.com/dns-targeted-zone-builds/, retrieved 2026-11-16.