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:
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:
- Cloudflare Workers applications — D1 is a first-class binding with native Worker API access
- Low-latency reads from anywhere — data is replicated to 300+ locations on Cloudflare's edge network
- Small to medium datasets — up to 10GB per database on the free plan, 50GB on paid
- Projects that want zero database ops — no servers, no connection pooling, automatic backups, no configuration
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, limitedALTER 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:
- Complex applications with advanced query needs — window functions, CTEs, recursive queries, lateral joins
- Data analytics and reporting workloads — 50+ built-in aggregate functions, parallel query execution
- Applications requiring JSONB, full-text search, or PostGIS for geospatial data
- Teams that want maximum SQL standard compliance — 170+ of 179 mandatory SQL:2023 features
Trade-offs:
- Requires a server (or managed service like Neon, Supabase, or AWS RDS)
- Higher latency for globally distributed reads without read replicas or edge caching
- More complex configuration and tuning — dozens of knobs (shared_buffers, work_mem, effective_cache_size, etc.)
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:
- Web applications — MySQL is the default database for WordPress (43% of all websites), Laravel, and the PHP ecosystem that built the early web
- Read-heavy workloads — MySQL's built-in replication is simpler to set up than PostgreSQL streaming replication
- Teams with existing MySQL expertise — 40.5% of developers use MySQL, making it the second-largest talent pool
- Projects that need wide hosting compatibility — supported by AWS RDS, Google Cloud SQL, DigitalOcean, and virtually every shared host
Trade-offs:
- Fewer advanced features than PostgreSQL — JSON support exists but lacks PostgreSQL's JSONB indexing; window functions were only added in MySQL 8.0 (2018)
- SQL standard deviations — e.g., implicit GROUP BY behavior and silent data truncation unless strict mode is enabled
- Licensing — MySQL is dual-licensed (GPL + commercial) under Oracle's stewardship, which led to the MariaDB fork over governance concerns
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.
- D1: connects via Cloudflare's REST API with your Account ID and API token
- MySQL: connects via the native wire protocol (no ODBC drivers needed)
- PostgreSQL: connects via the native wire protocol with full TLS support
- SQLite: opens local
.sqlite,.db, or.sqlite3files via the SQLite C API
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