// Engineering notes

Edge-native vs edge-deployed

Published · ·Last updated ·

EOXLABS calls a system edge-native when its state, coordination and failure domains are designed for the edge, not only its code. An edge-deployed system runs request handlers in edge locations but still sends every meaningful read and write to one regional origin. The difference shows up in tail latency, in how far an outage spreads, and in cost.

We keep the two terms apart because "runs on the edge" is true of both, and it hides the question that matters: where does the request actually wait?

What does "edge-deployed" mean?

An edge-deployed system has moved its compute and kept its architecture. The Worker terminates TLS near the user, perhaps checks a cache, and then calls the same regional API and the same primary database the system used before. The request is born at the edge and does its real work in one region.

That is a legitimate design, and often the right first step in a migration. It is not edge-native, because the slowest and least available part of the request path has not moved. A user far from the primary region still pays the long round trip, now with an extra hop in front of it.

What does "edge-native" mean?

An edge-native system gives each piece of state a home chosen by who reads and writes it, and treats the consistency of every read path as an explicit decision. On the Cloudflare platform that usually means three things.

First, per-entity coordination state lives in a Durable Object, which Cloudflare describes as a Worker that "uniquely combines compute with storage", created close to where it is first requested. A tenant, a document, a chat room or a device fleet each gets its own object. See our Durable Objects stack page.

Second, read-heavy data is replicated or cached with a declared staleness budget. D1 read replication serves reads from replicas, and its Sessions API gives sequential consistency within a session. Workers KV is eventually consistent: Cloudflare states that changes may take up to 60 seconds or more to be visible in other locations.

Third, the regional dependencies that remain are named, pooled and few. Hyperdrive pools connections to a regional Postgres database and caches popular queries, so a Worker can reach Neon Postgres without opening a fresh connection per request.

How do edge-native and edge-deployed systems differ?

DimensionEdge-deployedEdge-native
State placementOne primary database in one region; the edge holds caches at mostEach entity's state has a home near its users (an object per tenant, room or inbox), plus read replicas
Cold pathsA cache miss or a first request travels to the origin, across an ocean if the user is far awayA miss resolves at the entity's home or a nearby replica; isolates start without booting a VM or container
Data gravityData pulls compute back to its region; the Worker often runs there to stay closeCompute follows data that is already distributed; regional data is the named exception
Failure domainsAn origin or region outage takes down every route for every customerA failure is scoped to one object, tenant or replica; unaffected entities keep serving
ConsistencyImplicit: whatever the primary gives, plus accidental staleness from cachesDeclared per read path: strong inside an object, sequential within a D1 session, eventual in KV

The cold-path row rests on the runtime. Cloudflare says its V8 isolate model "eliminates the cold starts of the virtual machine model". That only helps if the request doesn't then wait on a distant database, which is the whole point of the table.

Which architecture smells show a system is only edge-deployed?

We look for these in an audit. Two or more usually means the edge layer is a proxy.

  • Every route awaits a query to one regional database, including routes that only read the caller's own data.
  • Smart Placement or a placement hint is switched on for the whole Worker, because without it each request pays several round trips to the backend.
  • Session, rate-limit or lock state lives in one central store that every location calls.
  • Workers KV is used where the code assumes a write is immediately visible to a read in another location.
  • A scheduled job on one machine sweeps every tenant (we replace these with per-object alarms).
  • Real-time features poll the origin, or hold WebSockets on a regional server fleet instead of hibernating WebSockets in a Durable Object.
  • Authorization calls back to the origin instead of verifying a signed token at the edge.
  • An incident in one cloud region is an incident for every customer in every country.

The second smell deserves a note. Smart Placement measures request duration from candidate locations and forwards a request when another location is "significantly faster". That is the correct fix for a chatty regional dependency. It is also a measurement telling you the dependency dominates.

When is edge-deployed the right answer?

Not every system should be edge-native, and we say so in design reviews. Edge-deployed is the better choice when:

  • Data residency rules pin a dataset to one jurisdiction, and a regional database is the simplest way to show where it lives. Durable Objects do support jurisdictions such as eu and fedramp, but the relational core may still belong in one region.
  • The workload is dominated by joins and aggregates across the whole dataset: reporting, billing, analytics.
  • Write volume to shared rows is high and contention, not distance, is the bottleneck.

In those cases we keep the database regional, pool it with Hyperdrive, run the Worker near it, and call the result edge-deployed on purpose. The edge architecture capability covers how we draw that line per route.

How does EOXLABS move a system from one to the other?

We map every route by the state it touches and who writes that state. Per-entity coordination moves into Durable Objects first, because it tends to give the largest latency and correctness gain for the least schema change. Read paths move to replicas or caches next, each with its consistency written down. The cross-entity relational core stays regional until there's a reason to move it. Routes cut over one at a time behind the Worker, a strangler fig migration in the usual sense. The legacy-to-edge migration capability and our note on moving a monolith to the edge go deeper.

Our design target is under 50 ms p50 at the edge. It is a target, not a measured guarantee, and the placement of state decides whether a route can meet it more than any code-level tuning does. Our internal p50 and p99 figures for the same workload served both ways are available on request at contact@eoxlabs.dev.

What would we do differently?

The object key is the decision you can't cheaply undo. The same data location reference states that Durable Objects "do not currently change locations after they are created", and the ID is effectively the shard key. One object per tenant is simple, and it becomes a hot spot for a large tenant: each object has a soft limit of 1,000 requests per second. One object per user or per conversation spreads the load and makes cross-entity queries harder. We spend more design time on that key than on any other single choice.

We'd also avoid treating "edge-native" as a goal for every route. Admin screens, exports and billing can stay regional without anyone noticing. And we'd write the consistency of each read path in the code, as a type or a named helper, rather than in a diagram that drifts.

More notes in this vein are in our engineering notes.

— DL

→

Related

+

More engineering notes

Have a system that can’t go dark?

Start a project →