The Zone Builder previously received around 250 DNS record changes per second; that figure now stands near 700, alongside roughly 100 other events per second such as zone setting changes. Volume was never the underlying constraint. The difficulty lies in the type of work certain events demand and how that work scales with zone size — some zones exceed 20 million records, with expectations of growth toward hundreds of millions.
Every event starts a clock measuring how long it takes to turn that change into data the authoritative DNS servers can consume. That unit of work is a build: it reads current database state, converts it into the edge format, and writes differences to Quicksilver. In 2022, per-record builds averaged 150 times faster than full builds, and 4,250 times faster on a one-million-record test zone. That post closed by naming the obvious next step: applying the same treatment to zone settings.
Why doesn't the Zone Builder just rebuild the setting that changed?
It should, and eventually it did — but establishing when that was safe consumed most of the effort. A record event identifies its change; a zone event can originate from many Cloudflare products, may omit any explanation, and can touch data shared by several zones bearing the same name. Over-selecting work wastes capacity; under-selecting risks stale or incorrect DNS data at the edge.
The answer is a targeted build planner that picks the smallest build provably safe, paired with a new scheduler that coalesces work for the same zone. Zone setting changes no longer trigger rebuilds of zones holding tens of millions of records. The combined result: peak memory down 85%, and the reclaimed headroom allowed the pipeline to safely shorten its long-standing resilience waits — halving the time from a DNS change to its data being written to Quicksilver.
The path from change to edge
A zone is the collection of records and settings for a domain, and a multi-stage pipeline carries changes through it:
- A customer edits a DNS record via the DNS Records API or dashboard, or another Cloudflare service alters a zone setting.
- The change lands in a database.
- The database change or another system emits a Kafka event.
- The DNS Kafka Aggregator merges events across several Kafka topics and forwards them to the Zone Builder.
- The Zone Builder reads the required zone data and converts it into keys understood by the authoritative DNS servers.
- The Zone Builder diffs those keys against Quicksilver and writes only what changed; Quicksilver propagates the result across Cloudflare's network.

This is a simplification. The Zone Builder does not lift database rows straight to the edge: it joins records to zone settings, applies DNS serving rules, and lays out the output for fast reads by the authoritative servers.
Where the full-build model broke down
The original design had one virtue: it needed no knowledge of why a zone changed, because it reconstructed desired state from the database. The steps — read zone and settings, read every record, encode into Quicksilver keys, compare against stored keys, purge stale keys and write changes plus zone metadata — meant that although the final write carried only deltas, the build still read, encoded and compared every record while holding the entire zone in memory. Fine for small zones; for the largest ones the zone does not fit in memory at all.
Zone settings also complicated targeting. Universal SSL is the canonical example: toggling it updates metadata and can alter Certification Authority Authorization (CAA) records at the zone apex — the bare domain, such as example.com — which tell certificate authorities whether they may issue certificates for that domain. Where a full build only needed to know a zone changed, a targeted build must answer three questions: which DNS names can change, whether shared metadata or the published-zone list can change, and which prior state must be removed from Quicksilver.
Answering them safely came down to five problems, addressed in turn: events had to declare their changes; each change had to map to the smallest correct build; builds had to respect data shared by same-name zones; the database could shift between event and build; and merging work could not drop a Kafka message.
Giving events enough detail
The event producer now includes changed zone fields and settings, carrying previous and new values where available. Each setting was traced through the DNS-output code path and classified by what it can affect.
Some events remain vague. Certain database functions only touch a timestamp — effectively signalling "something about this zone changed." That may be harmless bookkeeping or may mean data changed elsewhere and must be re-read; the event cannot distinguish. Until the caller and its intent can be identified, a timestamp-only update still forces a full build, as do missing details, unknown events, and any change that might affect records anywhere in the zone. Uncertainty is never converted into less work.
Five build types
Two parts of Quicksilver output matter here. Record keys hold the DNS answers for a single zone and name. A smaller shared metadata key tells the authoritative servers how to use the zone, including where to find special records such as nameservers and wildcards. Some events touch only record keys; others must update both.
The planner therefore selects among five build types:
- Resources only: rebuild records at specific DNS names (resources) without touching zone metadata — the usual path for A, AAAA, TXT and CNAME changes.
- Resources and metadata: rebuild specific names plus shared metadata — used for nameserver and wildcard changes.
- Apex and metadata: rebuild the zone apex and metadata — settings such as Universal SSL can take this path.
- Purge: remove a zone that should no longer be published.
- Full zone: rebuild everything when smaller work cannot be proven safe.
The governing rule: every key a targeted build writes must be byte-for-byte identical to what a full build would write. Otherwise, the system falls back to a full build.
Stale-state removal mirrors the 2022 per-record design. Record events include deleted records and the prior version of updated ones; the Zone Builder scans Quicksilver for existing keys under each name it rebuilds and drops any the new build did not write.
Full builds remain necessary when a change can affect records anywhere in the zone, or when a zone may need publishing for the first time. One exception is deliberate. A full build holds every database record and every existing Quicksilver key for the zone in memory simultaneously, which our largest zones exceed. Above a fixed record-count threshold, the Zone Builder never escalates to a full build; instead it rebuilds the apex, the metadata, and every name named by queued events. The tradeoff is acceptable because a full build of such a zone cannot complete, and while it retries it stalls every other change on its Kafka partition. Many otherwise-full-build cases involve multiple zones sharing one name, and zone holds mitigate that risk by preventing the same name from being added to another account; the rare remainder, such as enabling a zone on another network, can be handled by manually rebuilding individual names.
One name, many zones
Quicksilver stores each zone's record keys separately, but a single metadata key is shared by every Cloudflare zone for a given domain. That key behaves like a directory: it lists the internal zone IDs the authoritative servers may use when answering a query.
The reason a name can map to several IDs is lifecycle churn — onboarding, offboarding and similar transitions can briefly leave multiple zone objects for the same public domain. A priority policy selects a small, bounded set for publication.
Take four internal zones for example.com: 101, 202, 303 and 404. The metadata key currently lists 101, 202 and 303; 404 exists but is unselected. The IDs identify distinct Cloudflare zone objects, while customers see a single domain. A TXT change at www.example.com in Zone 202 touches only Zone 202's record keys, leaving the metadata key untouched. Nameserver and wildcard changes differ: because metadata records information about them, those builds must update both.
At execution, the Zone Builder re-reads the current list. If it writes the metadata key, it rebuilds that key entirely from the fresh view rather than patching an older copy, and it writes the triggering zone's records before the metadata referencing them.
Plan conservatively, verify at the last moment
An event describes the past. A build may wait while further events land and the database moves, so planning happens twice: the event first yields a conservative work list, and immediately before execution the Zone Builder reads a fresh publication snapshot — current zone settings, whether this Zone Builder 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 Quicksilver copy for one environment; each Zone Builder deployment writes to one network, and a zone can be enabled on some but not others, for example both Cloudflare's global network and the China Network.
Fresh state can alter the outcome in four ways:
- A targeted build escalates to a full build if the zone now has a feature requiring complete-zone work.
- A build becomes a purge if the zone should no longer be published to that network.
- A build is skipped if the triggering zone no longer belongs in the metadata key.
- A metadata build reconstructs the shared key from the current candidate set.
The fresh read targets read-only database replicas, keeping builds off customer write paths. Kafka delivery and replication advance independently, so an event can arrive before its change is visible on a replica. The DNS Kafka Aggregator delays events enough to absorb normal lag, and a final database check rejects the read if a replica is still behind.
One scheduler for all work
Record work and full-zone work once ran under separate schedulers, each able to merge only its own kind of work. These have been replaced by a single unified scheduler: the planner decides what must be built, the scheduler decides when it runs.
When multiple events for a zone queue up before a build starts, their work merges:
- An A record change at
www.example.comrequires that name. - A wildcard change at
*.example.comrequires that name plus shared metadata. - The scheduler folds both names and the metadata update into a single build.

Merging can only add work: if any event requires the complete zone, the combined build is a full build, and a purge takes precedence over any rebuild since its desired end state is an unpublished zone.
The scheduler tracks two things independently: the DNS work to execute and the Kafka messages still awaiting acknowledgement. A retry preserves both — even when a full build or purge no longer needs the individual record names, the messages stay attached until the result is durably written.
Scheduling around Kafka's ordering constraint
Kafka orders messages within partitions and tracks a single committed offset per partition — the point up to which all messages are known complete. Advancing that offset past unfinished work risks losing a customer change on restart. The system therefore uses soft committing: a build may finish out of order and be marked complete in memory, but the committed position only moves once every earlier message has also finished.

A message that is still running blocks commit for everything behind it. Should the Zone Builder restart, those in-memory completions are lost and Kafka replays the unfinished range. Repeated work is accepted deliberately in exchange for never dropping a change.
Targeted plans shorten the time the oldest message stays unfinished, and the scheduler stops one busy zone from claiming every worker. After a zone builds, its next build is held until a per-zone rebuild interval passes; the interval varies by Cloudflare plan, and changes arriving in between are folded into that next build. The scheduler normally enforces the interval but lets old queued work run before it blocks a Kafka partition too long. Zone locks and retry delays remain in force, so failing builds cannot spin.
Verifying equivalence before release
A smaller build is only acceptable if it yields identical DNS data. Equivalence tests cover nameserver, wildcard and apex paths: each 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. Separate planner and scheduler tests cover classification, same-name zones, merging, purges and escalation.
During rollout, a full build ran alongside every targeted build and the outputs were compared. It was expensive by design — it read the whole zone each time — so it stayed in place only until the mirror comparison provided equivalent confidence.
Since tests cannot reproduce every customer combination, each release also passes through a mirror Zone Builder. It consumes the production Kafka stream and reads production database state, but writes into a separate Quicksilver environment that serves no customer traffic.

A comparer samples 20% of zones and checks for missing keys, extra keys and differing values. The two environments do not build a zone at the same instant, so transient mismatches are not treated as regressions; what matters are new kinds of differences that persist after both pipelines catch up.
Differences are grouped by the DNS Mirror Dashboard, which keeps examples for investigation. It runs on the Cloudflare Developer Platform: a Worker receives results, Durable Objects maintain state, and Cloudflare Access protects it. Before release, each critical group in the screenshot was checked and confirmed safe. The diff rate is the share of compared zones where production and mirror disagreed on at least one key at the moment of comparison; most such cases are timing artifacts that vanish once the pipelines converge. Two signals are watched: that the rate stays low, and that no new kind of difference appears.

Once mirror results stayed healthy, the scheduler rolled out by a hash of the zone name. Hashing the name rather than the zone ID keeps every zone sharing a name on the same scheduler, so two schedulers never write the same metadata key. The rollout percentage was raised for free zones first, then the process was repeated for paid zones.
Measured outcomes
Over a 24-hour window, 86.81% of builds were classified as resources only, 2.54% as resources and metadata, 2.30% as apex and metadata, and 1.30% as purges. In total 92.95% of builds avoided rebuilding the complete zone; full builds made up the remaining 7.04%.
Both metadata build types had previously been full builds even for large zones, and together they account for 4.84% of builds. Added to the 7.04% that remain full builds, that gives 11.88% — a reduction of roughly 40% in full builds. Their share of the count also understates the work avoided, since they include the largest zones. The full builds that remain average 0.35 seconds, because the events that still trigger them, such as a zone being published for the first time, mostly affect new zones with few records.

A batching system planned in 2022 is no longer needed. The unified scheduler does not wait to form batches and merges events only when work is already queued for the same zone. Fewer long full builds no longer hold back their partition's committed offset, so Kafka is now consumed at the rate events arrive rather than falling behind and catching up in bursts of up to 1,550 messages per second.


Build completion delay was also measured — the time from a DNS record or zone setting change until the Zone Builder finishes writing to Quicksilver, excluding Quicksilver's distribution across the network. Production ran the old schedulers while the mirror ran the unified scheduler on the same events over the same 24 hours; the environments are identical apart from the code, consuming the same Kafka events, reading the same database and writing equivalent data to Quicksilver, which makes it a controlled side-by-side comparison. The figures combine all build types and customer plans and are not a latency guarantee for any individual zone, and much of the time is the rebuild interval rather than build work. Typical delays barely moved, since most builds were already small. The tail is where the change shows: the largest p99 spike dropped from 14.6 minutes to 1.21 minutes, a 12-fold reduction, on a logarithmic scale in the chart.

Targeted builds also rarely load complete large zones. Aggregate working-set memory — the memory actively used by the deployment — fell from an average of 49 GiB to 7 GiB, an 86% reduction, with peaks falling from 79 GiB to 12 GiB, down 85%.

With builds cheaper and far fewer of them reading complete zones, two safeguards could be revisited. The first is the rebuild interval, which stops one busy zone from rebuilding constantly at everyone else's expense; it could safely be shortened on most plans. The second is how long the DNS Kafka Aggregator holds each event so database replicas can catch up before a read; once the databases began rejecting reads from replicas that had fallen behind, that buffer could be smaller. Together they halved the median build completion delay from about 7.7 seconds to about 3.3 seconds. In the chart, the first step down corresponds to the DNS Kafka Aggregator change, while the red band marks the Zone Builder release with shorter rebuild intervals, which rolled out gradually across servers, so the delay falls in two further steps.

The p90 and p99 lines in that chart are less precise than they appear: the histogram had buckets at 1, 5, 10 and 30 seconds, and a percentile falling between two edges is estimated as if delays were spread evenly across that range. Most delays sit near the bottom of their range, so the estimates come out high — p99 reads close to 30 seconds and p90 above 7. The exact average, independent of buckets, confirms the halving. A switch to native histograms, which choose fine-grained buckets automatically, puts p90 at about 5.5 seconds and p99 at about 12 seconds.

Full builds remain by design
The 2022 plan to eliminate full builds entirely turns out to be neither realistic nor useful. A zone published for the first time needs every record written. A change that can affect records anywhere in the zone needs every record checked. An event that does not say what changed still gets a full build, because the planner never converts uncertainty into less work. For a small zone, a full build is cheap anyway.
As more is learned about what each event changes, those events will keep moving to targeted builds. The largest gain has already landed: events that used to rebuild the largest zones no longer do, and remaining full builds are mostly triggered by events such as first publication, which affect new, small zones.



