← Back to blog
Admin 5 min read

Cloudflare D1 vs MySQL vs PostgreSQL: Which Should You Use in 2026?

Cloudflare D1 vs MySQL vs PostgreSQL: Which Should You Use in 2026?

The database landscape in 2026 looks different than it did five years ago. Cloudflare D1 joined the conversation as a globally distributed SQLite database baked into the edge. MySQL and PostgreSQL remain the workhorses of production infrastructure. So which one should you use?

The answer, for most teams, is: more than one. Here's when each makes sense.

TL;DR — Which database should you pick?

PostgreSQL Your default choice for most apps. Advanced queries, JSONB, full-text search, PostGIS. Used by 55.6% of developers.
Then: born in academia (1986), chosen for correctness over speed. Now: #1 database among developers — fast, extensible, and the industry default for new projects.
MySQL Best if you're in the PHP/WordPress/Laravel ecosystem, need wide hosting support, or have an existing MySQL team.
Then: the database that powered the LAMP stack and made the web possible (2000s). Now: still #2 at 40.5%, backbone of WordPress (43% of all websites) and most shared hosting.
Cloudflare D1 Best for edge-first apps on Cloudflare Workers. Zero ops, global reads, free tier. SQLite under the hood.
Then: SQLite was an embedded database for mobile apps and browsers (2000). Now: D1 brings SQLite to the edge — globally distributed, serverless, used by 37.5% of developers.
All three Many teams use D1 for edge data + PostgreSQL or MySQL for core data. Use MyD1 to manage them all from one app.

Developer usage in 2025

Before we dive into each database, let's look at the numbers. The 2025 Stack Overflow Developer Survey (26,083 respondents) shows which databases developers actually use:

% of developers who use each database 26,083 respondents
PostgreSQL
55.6%
MySQL
40.5%
SQLite
37.5%
SQL Server
30.1%
Redis
28.0%
MongoDB
24.0%
MariaDB
22.5%

Source: Stack Overflow Developer Survey 2025 — multi-select question

PostgreSQL leads for the third consecutive year at 55.6% — up from 48.7% in 2024. SQLite (which powers Cloudflare D1) sits at 37.5%, ahead of SQL Server. The key takeaway: the three databases in this comparison are used by the vast majority of developers.

Cloudflare D1

D1 is SQLite running on Cloudflare's global network. Your database lives at the edge, close to your users, with automatic replication across regions.

Best for:

Trade-offs:

  • Write throughput is lower — D1 uses a single-writer architecture where writes go to one primary location
  • SQLite dialect, not full PostgreSQL/MySQL compatibility — e.g., no ALTER COLUMN, limited ALTER TABLE
  • Tooling ecosystem is still growing — observability and migration tools are newer than MySQL/PostgreSQL equivalents
  • No stored procedures; triggers are SQLite-level only (no D1-specific extensions)

PostgreSQL

PostgreSQL is the most feature-complete open-source relational database. It handles complex queries, advanced data types (JSONB, arrays, full-text search), and heavy workloads gracefully. It has been the most popular database among developers for several years running, and the SQL standard compliance documentation speaks for itself.

Best for:

Trade-offs:

MySQL

MySQL powers a huge portion of the web. It's the database behind over 40% of all websites that use a known DBMS. It's battle-tested, fast for read-heavy workloads, and has the largest ecosystem of tools and hosting providers.

Best for:

Trade-offs:

The real-world pattern: using more than one

The Stack Overflow 2025 survey shows developers commonly use multiple databases: PostgreSQL (55.6%), MySQL (40.5%), and SQLite (37.5%) all rank in the top three — and since the question is multi-select, many respondents checked more than one. A natural pattern is using D1 (SQLite at the edge) for low-latency features like session storage or feature flags, alongside PostgreSQL or MySQL for core application data.

The challenge is managing all of them. If your D1 databases live in the Cloudflare dashboard, your PostgreSQL in pgAdmin, and your MySQL in Sequel Pro, that's three tools, three workflows, three sets of muscle memory.

One client for all four

MyD1 connects to Cloudflare D1, MySQL, PostgreSQL, and local SQLite databases from a single native macOS app. Same query editor, same table browser, same keyboard shortcuts — regardless of which database engine you're talking to.

Switch between your production PostgreSQL, your staging D1, your local MySQL, and your SQLite files with a single click in the sidebar.

Download MyD1 — free for all four database engines.

Related: Browse and Query D1 Visually · Build a Full-Stack App on Cloudflare for Free · TablePlus vs MyD1