Technology comparison

Cloudflare D1 vs PlanetScale: edge SQLite vs serverless MySQL

D1 wins on latency. PlanetScale wins on massive scale and branching. Small SaaS almost always wants D1.

2026-07-01

Huifer
Huifer · Indie Developer→ /about

SQLite vs MySQL choice: - D1 (SQLite): Sufficient for 99% of my SaaS usage, and free - PlanetScale (MySQL): Considered for a large-scale project I ultimately chose D1 because: my app (< 1B reads/month) doesn't need PlanetScale's scalability. But if your goal is Shopify-level, PlanetScale's Vitess backend is the only choice. Below, I'll help you decide.

TL;DR

  • Pick D1 for edge deploy under 1B reads/month.
  • Pick PlanetScale for MySQL-scale, branching, and enterprise workloads.
DimensionCloudflare D1PlanetScale
EngineSQLiteMySQL (Vitess)
Latency at edgeSub-10ms30–100ms
Scale ceilingVery high (edge reads)Effectively unlimited
BranchingBasicFirst-class
Cost (small)Effectively free$39+/mo
Foreign keysYesNot enforced

Scale profile

PlanetScale (Vitess-backed) is proven at massive scale — Shopify-tier, if you get there.

D1 is more than enough for the first 5 years of most SaaS.

Branching workflows

PlanetScale's schema branching (Git-like) is genuinely useful in team workflows.

D1 has basic environment separation but not full branching.

Where TanStack Ship fits

TanStack Ship uses D1 by default — for the vast majority of SaaS products, edge SQLite is more than enough and effectively free. If you outgrow it, the data layer abstraction lets you migrate to PlanetScale or Postgres without rewriting your product.

Frequently asked questions

Which is cheaper?

D1 by a wide margin at small scale.

Which for team schema workflows?

PlanetScale — branching is best-in-class.

Which for edge deploy?

D1 — bundled with Workers.

Does D1 support foreign keys?

Yes.

Does PlanetScale support foreign keys?

Not enforced — a MySQL/Vitess constraint.

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.