VCA

Choosing a database: D1 vs Postgres vs SQLite

How to pick among the three databases beginners meet most: what each suits, how the free tier works, and how not to overthink it.

Published Updated Reviewed 1 min readEditorial policy#Guide#Database#Selection

In one sentence

SQLite is simplest, Postgres is most capable, D1 fits Cloudflare best. For most beginner projects, just pick the simplest one that works.

What you'll build

A clear call on which database your project should use and why — no more choice paralysis.

The conclusion first

Don't agonize over a new project: pick the one that's simplest while still meeting your needs. There's no absolute best database, only a fit for where you are now.

The one-line difference

  • SQLite: a single file is the whole database — zero setup, super simple, runs right next to your code.
  • PostgreSQL: the most complete, the most widely used, the biggest ecosystem — scales from tiny to very large.
  • D1: Cloudflare's SQLite-based cloud database, integrates seamlessly with Pages/Workers, with a friendly free tier.

Side by side

DimensionSQLitePostgreSQLD1
Ease of useLowestMediumLow (if you know SQLite)
Suited scaleSmall to mediumSmall to very largeSmall to medium (growing)
DeploymentBundled with the appNeeds a database serverNative on Cloudflare
FreeFree by natureDepends on your hostHas a free tier
Cloudflare fitNo direct integrationExternalNative, smoothest

How to choose

  • Pure learning or a local tool → SQLite.
  • Deploying on Cloudflare and want one stack → D1.
  • Complex queries, heavy concurrent writes, or the most mature ecosystem → PostgreSQL.

Good news: they're a lot alike

All three are SQL databases, and the basic "create table, query, insert, update" syntax is largely shared (D1 is SQLite). So start with the simple one; if you genuinely outgrow it, moving is less scary than you'd think — but it isn't free either, so spending five minutes to pick the right scale up front is still worth it.

Next steps

Frequently asked questions

As a beginner unsure which to use, what’s the safest default?

Pick the one that’s simplest while meeting your needs: SQLite for pure learning or a local tool; D1 if you’re deploying on Cloudflare (if you know SQLite, you know it). Reach for PostgreSQL only when you need complex queries, heavy concurrent writes, or the most mature ecosystem.

If my data grows, will switching databases hurt?

All three are SQL with largely shared syntax (D1 *is* SQLite), so a move is less scary than you’d think — but not free either: data migration, syntax differences and downtime all need handling. So picking the right "scale" up front beats moving later — worth five minutes of thought.

References

  1. Cloudflare D1 DocumentationCloudflare
  2. PostgreSQL DocumentationPostgreSQL Global Development Group
  3. SQLite DocumentationSQLite