How we push a kill switch to 312 edge nodes in 38 ms
A kill switch that takes a minute to arrive is a status page with extra steps. How our control plane fans a single write out to 312 edge nodes, and where the 38 ms actually goes.

When a payment provider starts failing at 2 a.m., the only number that matters is how long it takes for the switch you just flipped to be true everywhere. For Driftwire that number is 38 ms at p99, measured from the write committing in the control plane to the last of 312 edge nodes serving the new value.
This post walks through where those milliseconds go, and the two designs we threw away on the way.
The shape of the problem
Every SDK evaluates flags locally, against a ruleset it holds in memory. That is what makes evaluation fast (isEnabled() never makes a network call), and it is also what makes propagation hard: a change is only real once every copy of the ruleset has it.

What we tried first
Polling
Version one had every edge node poll the control plane every five seconds. Simple, stateless, and wrong: the median kill switch took 2.5 s to land and the worst case was a full interval. Shortening the interval just moved the cost onto our database.
A global pub/sub topic
Version two pushed changes through a single managed topic. Latency dropped to around 400 ms, but a regional outage of the broker meant a region silently stopped receiving changes — the one failure a kill switch cannot tolerate.
What ships today
Each region runs its own relay. The control plane writes the change, then pushes a compact diff to every regional relay over a long-lived HTTP/2 stream. Relays fan out to their edge nodes the same way. Every message carries a monotonic version, so a node that misses one notices the gap and fetches a full snapshot.
// What an edge node receives: a diff against the version it holds.
interface RulesetDiff {
version: number
previous: number
changed: Record<string, FlagRules>
removed: string[]
}
function apply(diff: RulesetDiff) {
if (diff.previous !== store.version) return resync() // missed one: fetch a snapshot
store.merge(diff.changed, diff.removed)
store.version = diff.version
}A kill switch should fail loud. If a node cannot prove it holds the latest version, it says so — it does not quietly serve what it had.
Where the 38 ms goes
- Control plane commit and fan-out: 6 ms
- Control plane to regional relay: 9–21 ms, depending on distance
- Relay to edge node: 2–5 ms
- Apply and swap the in-memory ruleset: under 1 ms
The long pole is the speed of light between continents, which is why the next step is not a faster protocol but more relays.

Written by
Avery Lin
Staff Engineer, Edge
Avery builds the edge evaluation layer at Driftwire: the part that answers "is this flag on?" four hundred thousand times a second without asking anyone.
More posts by Avery Lin

