DEV Community

niuniu
niuniu

Posted on

I Ran the Same Serverless DB on Turso, Neon, and Cloudflare D1 — One Clear Winner

Last week I benchmarked Supabase vs Neon vs PlanetScale. A commenter asked: "Why not Turso and D1?" Fair point — the serverless SQLite/Postgres war is where the real action is in 2026.

Same workload, three free tiers: a URL shortener with 10k reads/day, 500 writes/day, and a cron that expires old links every hour.

The Contenders

Turso Neon Cloudflare D1
Engine libSQL (SQLite fork) Postgres SQLite
Free tier 9GB storage, 25M reads/mo 0.5GB storage, 190 compute hrs 5GB storage, 5M reads/day
Cold start ~5ms ~300ms ~0ms (same isolate)
Pricing after free $29/mo $19/mo $5/mo + overage

Setup

# Turso — embedded replica, zero network on read
import libsql_experimental as libsql
conn = libsql.connect("urls.db", sync_url="libsql://xxx.turso.io", auth_token="...")
conn.execute("CREATE TABLE IF NOT EXISTS urls (id TEXT PRIMARY KEY, url TEXT, expires_at INTEGER)")

# Neon — serverless Postgres over HTTP
import psycopg2
conn = psycopg2.connect("postgresql://xxx.neon.tech/db?sslmode=require")

# D1 — Cloudflare Workers binding (Wrangler)
# wrangler.toml: [[d1_databases]] binding = "DB" database_name = "urls"
Enter fullscreen mode Exit fullscreen mode

Results After 14 Days

Metric Turso Neon D1
p50 read 8ms 45ms 3ms
p99 read 120ms 890ms 45ms
Cold start penalty none 300ms none
Writes/day limit hit never never 1x (5M read cap)
Cron job complexity embedded separate worker native

Turso's embedded replicas are the killer feature — reads happen locally, sync happens in background. Neon has the most "real Postgres" features but you pay for every cold start. D1 is absurdly fast for reads but the SQLite dialect bites you when you need ILIKE or real JSON operators.

The Controversial Take

If your app is read-heavy and globally distributed, Turso is the only choice that makes sense. Neon's cold starts are a UX killer for side projects. D1 is great until you need UPDATE ... RETURNING or ON CONFLICT with partial indexes — then you realize SQLite is not Postgres with a different wire protocol.

I migrated my webhook deduplication from Upstash to Turso this week. Same workload, 40% fewer p99 spikes, and the bill is $0.

I sketched the migration script with MonkeyCode: https://ly.cyberserval.tech/iIETXiF

Which serverless DB are you betting on — and has anyone hit D1's 5M daily read limit in production?

coding #webdev #opensource #tips

Top comments (0)