Technology comparison

Cloudflare D1 vs Supabase: which database for your SaaS?

D1 is edge SQLite. Supabase is managed Postgres. The choice is really about latency vs features.

2026-07-01

Huifer
Huifer · Indie Developer→ /about

My database usage experience: - D1: Used for 2 edge apps, latency stable below 10ms - Supabase: Used for 3 traditional apps, richer features but higher latency If you need Postgres features (pgvector, RLS), Supabase is the only choice. But if your app is read-heavy and needs global low latency, D1's edge replication is a killer feature. Below, I'll explain my migration experience in detail.

TL;DR

  • Pick D1 if you deploy to Cloudflare Workers and want sub-10ms edge reads.
  • Pick Supabase if you need Postgres extensions (pgvector, pg_cron), RLS, or native realtime.
DimensionCloudflare D1Supabase
EngineSQLitePostgreSQL
Latency at edgeSub-10ms30–200ms
RLSDIYNative
RealtimeDIY (WS + DO)Native
ExtensionsNonepg_vector, pg_cron, more
Pricing (small scale)Effectively freeFree tier, then $25+/mo
AuthDIYBuilt-in

Latency

D1 replicates read-only copies to Cloudflare's edge (300+ locations). Reads are sub-10ms globally.

Supabase runs in one region. Users far from that region pay latency in every request.

Feature depth

Supabase gives you Postgres — full RLS, extensions, pgvector for AI apps, native realtime.

D1 is SQLite — leaner, faster at the edge, but you build features Supabase gives you for free.

Cost

D1 has a very generous free tier and cheap per-write pricing.

Supabase's free tier is generous too, but the paid step is $25/mo minimum.

Where TanStack Ship fits

TanStack Ship defaults to D1 (edge speed, near-zero cost) with a data-layer abstraction that lets you swap to Supabase/Postgres if you need pgvector or Postgres-only features. You don't lock into either — you start on D1 and migrate later if a real Postgres need appears.

Frequently asked questions

Which is faster at the edge?

D1 — significantly.

Which for pgvector / RAG?

Supabase — pg_vector is native.

Which for realtime?

Supabase — first-class realtime engine.

Which for auth?

Supabase — built in. D1 requires you to bring auth.

Can I migrate D1 to Postgres later?

Yes. SQLite-to-Postgres migration is well-trodden.

Related Links

Ready to see TanStack Ship in action?

Ship a paid SaaS on TanStack Start with UTM attribution, MRR dashboards, and 14 growth modules built in — from $99.