Edge compute is useless without an edge data layer. Three serverless databases that put data within ms of your edge functions, with the tradeoffs that aren't on the marketing pages.
Edge compute solves one half of the latency problem: your code runs close to the user. The other half is data. A Cloudflare Worker that has to round-trip to a primary database in us-east-1 is no faster than a Lambda for a user in Singapore. The "edge database" category emerged to fill that gap — primary or replica data nodes co-located with edge compute regions, accessible with low latency from anywhere.
We've evaluated and shipped with three of them: Cloudflare D1, Turso (libSQL), and Neon Serverless. They solve overlapping problems with different tradeoffs. This is what we learned.
Traditional setup: your database lives in one region. Your edge code runs in 200+ POPs. The latency from a far POP to the database is whatever the inter-region link is (often 80–250ms). Your "edge function" is now slower than a Lambda right next to the database.
You want one of:
The three products below take different approaches.
D1 is Cloudflare's serverless SQLite, integrated tightly with Workers. Each D1 database has a single primary region (you pick when you create it) and read replicas in multiple regions. Reads from a region with a replica are fast; writes always route to the primary.
Best for: Cloudflare Workers apps with a strong-bias toward reads. Tightly integrated; no separate service to manage. Limits favor small-to-medium databases (current per-database storage cap is generous but real).
Where it surprises you:
We use D1 for one Worker-only feature with mostly-read traffic and small dataset. Works well. Wouldn't reach for it for write-heavy or multi-GB workloads.
Turso is a libSQL (a SQLite fork) hosted service. It supports the "embedded replica" pattern: your application has a local SQLite file that's continuously synced from the primary. Reads happen against the local file (microseconds); writes go to the primary; the local copy stays consistent via the replication protocol.
Best for: applications that can host a local replica. Edge functions with persistent storage, Node servers, mobile apps. Read latency goes effectively to zero. Writes are still primary-bound.
Where it surprises you:
Turso shines when you can put the embedded replica inside your app's runtime. For a long-running Node service near users (e.g. on Fly.io), the read story is hard to beat.
Neon is serverless Postgres — autoscaled compute, separate from storage, with branching (forks) for development environments. Not a true "edge database" in the multi-region-replica sense, but the serverless compute + cold-start story makes it work well from edge functions when you're OK with the network round-trip to a specific region.
Best for: applications that need real Postgres (joins, transactions, all the SQL features). Edge functions that hit a single region's Neon endpoint. Pattern works well when the bulk of users are in one geographic area; less so for truly global low-latency.
Where it surprises you:
We use Neon for a couple of services where we want real Postgres semantics and the workload is regional. Not for global low-latency.
A few we considered but didn't run with:
Cloudflare Durable Objects. A different primitive — strongly-consistent in-memory state with one canonical instance per "object." Good for coordination, counters, chat rooms; not really a database. We use them for some real-time state but not as a general data layer.
FaunaDB / DynamoDB Global Tables. Multi-region replicated databases. Real, mature, but the consistency models (eventual consistency in DynamoDB Global Tables; Calvin in Fauna) take effort to design around. We use DynamoDB Global Tables for one workload that fits its model.
PlanetScale. MySQL-compatible with global read replicas. Strong product; we use Postgres elsewhere so haven't migrated.
Self-hosted multi-region Postgres with Patroni or similar. Real but ops-heavy. For a small team, not worth it vs managed serverless.
Rough decision tree:
For most teams, the answer is: pick the database that matches your primary compute platform's locality model, with one region for writes and replication for reads. The cases where multi-region writes are actually required are rarer than the marketing suggests.
Per-database, the operational metrics:
Treating an edge database like a globally-strong DB. Writes have a primary region. Designing as if every replica was equally writable will bite you.
Heavy SQL with edge compute. Edge functions have tight CPU/memory budgets. A complex JOIN that takes 200ms of CPU in the function eats your latency budget regardless of how fast the database is.
Ignoring cold-start interaction. Serverless DB + serverless compute = 2 cold starts. Sometimes both fast, sometimes both not. Test from cold.
Replicating the primary database to every region "just in case." Costs money; rarely matches the actual access pattern. Replicate where users are.
Edge databases are a real category now, with credible options. The mistake is treating them as a drop-in replacement for traditional databases; the mental model needs to match the architecture. Once it does, the latency wins for global apps are substantial.
Get the latest tutorials, guides, and insights on AI, DevOps, Cloud, and Infrastructure delivered directly to your inbox.
Single-provider LLM apps fail when the provider does. Multi-provider routing isn't just resilience — it's also a cost lever. The patterns we run.
SBOMs and signed attestations sound like checkboxes until you need to answer "did this artifact come from our pipeline?" The minimum viable supply-chain story we run.
Explore more articles in this category
Bad resource requests waste money or trigger OOMs. The methodology we use to right-size requests based on actual usage, and the gotchas the autoscalers don't fix.
OIDC federation between AWS, GCP, and CI providers let us delete every long-lived cloud credential we had. The setup, the gotchas, and the trust-relationship discipline.
There are two hard problems in computer science." We've worked on the cache-invalidation one for a while. The patterns that hold up at scale and the ones that look clean and aren't.