Stepping past MySQL for JSONB and CTEs? Five alternatives
MySQL lacks modern features like JSONB, recursive CTEs and native partitioning. PostgreSQL and PlanetScale lead the pack. Compare 5 databases that offer more.
At MG Software, we recommend PostgreSQL as the default MySQL alternative thanks to its richer feature set, active independent community and complete absence of licensing risks. For teams that strictly require MySQL compatibility, MariaDB offers the safest migration path with minimal code changes.

Why do people look for alternatives to MySQL is the most popular open-source relational database in the world, holding over 40% market share among relational databases. It is owned by Oracle and widely used for web applications, CMS platforms like WordPress and Drupal, and e-commerce systems such as Magento and WooCommerce. MySQL uses InnoDB as its default storage engine with ACID transactions, built-in replication and a maximum row size of 65,535 bytes. The Community Edition is free, while MySQL Enterprise Edition starts at approximately $5,000 per year per server and includes Thread Pool, Audit Plugin and Enterprise Backup. MySQL 8.0 introduced window functions, CTEs and JSON improvements, but it still lags behind PostgreSQL in advanced SQL capabilities.?
Developers seek MySQL alternatives for several practical reasons. Oracle's licensing model creates uncertainty with the split between the free Community Edition and the expensive Enterprise Edition, leaving teams unsure about long-term costs. MySQL lacks features that PostgreSQL provides out of the box, including JSONB with indexing, materialized views, table inheritance and advanced partitioning strategies. The growing demand for serverless databases with scale-to-zero and automatic horizontal scaling does not fit MySQL's traditional client-server architecture. Teams also encounter limitations with MySQL's weaker CHECK constraints, the absence of native UPSERT before version 8.0 and a less strict default SQL mode that can allow unexpected data type conversions.
Best alternatives
PostgreSQL
PostgreSQL is the most advanced open-source relational database, supporting over 90 data types, JSONB with GIN indexing, full-text search, recursive CTEs, window functions and an ecosystem of more than 1,000 extensions. It is maintained by an independent community with no commercial owner. PostgreSQL 17 brings improved JSON_TABLE support, incremental backups and better query parallelisation. It is entirely free with no licensing fees or feature differences between editions.
Pros
- +Richer SQL feature set with recursive CTEs, window functions, materialized views and native partitioning
- +Extensive data type support including JSONB with GIN indexing, arrays, hstore and user-defined types
- +Independent community governance with no commercial owner, zero licensing risks and no vendor lock-in
- +Ecosystem of over 1,000 extensions including PostGIS, pgvector, TimescaleDB and Citus for specialised workloads
Cons
- -Slightly higher memory consumption than MySQL for simple read-heavy workloads due to MVCC overhead
- -Configuration tuning for optimal performance requires deeper knowledge of parameters like work_mem and shared_buffers
- -Replication setup is more complex than MySQL native binlog replication for simple primary-replica configurations
MariaDB
MariaDB is a community-driven fork of MySQL founded in 2009 by Michael Widenius, the original creator of MySQL. It provides full drop-in compatibility with MySQL and adds features including the Aria storage engine, ColumnStore for analytical workloads, temporal tables and an Oracle-compatible PL/SQL mode. MariaDB Community Server is free, while SkySQL managed hosting starts at $65 per month. Most Linux distributions ship MariaDB as their default MySQL-compatible database.
Pros
- +Drop-in replacement for MySQL with compatible connectors, SQL syntax and storage engine support
- +Faster release cadence with features MySQL lacks, such as temporal tables, sequences and system-versioned tables
- +Fully open-source under GPL without Oracle licensing risks or confusing edition differences
- +ColumnStore engine for analytical workloads that MySQL does not natively support
Cons
- -Slowly diverging from MySQL as newer MySQL 8.0+ features are not always adopted into MariaDB
- -Smaller enterprise ecosystem than MySQL with fewer certified partners and third-party integrations
- -SkySQL managed hosting is more expensive than comparable managed MySQL services on AWS or Google Cloud
SQLite
SQLite is an embedded relational database that operates as a single file with no separate server process or configuration. It is the most widely deployed database in the world, present in every mobile device, every web browser and countless IoT devices. SQLite is entirely public domain and maintained by D. Richard Hipp and a small core team. With the emergence of Turso and Litestream, SQLite is increasingly used as a production database for edge computing and lightweight web applications.
Pros
- +Zero configuration: the database is a single file requiring no server process or installation steps
- +Extremely lightweight and fast for read-heavy workloads with sub-millisecond response times
- +Ideal for local development, automated testing and edge deployments via Turso or Cloudflare D1
- +Public domain licence with absolutely no restrictions on usage, distribution or modification
Cons
- -Not suitable for high write concurrency: only one writer at a time even in WAL mode
- -No native network access or client-server architecture without tools like Turso or Litestream
- -Lacks advanced features such as stored procedures, INSTEAD OF triggers and user-level access control
PlanetScale
PlanetScale is a serverless MySQL-compatible database built on Vitess, the scaling layer originally developed for YouTube. It provides database branching for safe schema migrations, non-blocking schema changes, automatic connection pooling and horizontal scaling. The free tier was removed in April 2024, with the cheapest Scaler plan starting at $39 per month for 10 GB storage and 100 million row reads. PlanetScale Boost adds query caching for faster read operations on frequently accessed data.
Pros
- +Database branching for safe schema migrations comparable to Git branches for application code
- +Built on Vitess, proven technology that powers YouTube's database layer at massive global scale
- +Serverless with automatic horizontal scaling that requires no manual sharding or rebalancing
- +Non-blocking schema changes that do not slow down production queries during ongoing migrations
Cons
- -No support for foreign keys due to fundamental limitations in the Vitess sharding architecture
- -No free tier available since April 2024: minimum cost is $39 per month for the Scaler plan
- -Limited to MySQL compatibility, meaning PostgreSQL-specific features and extensions are unavailable
CockroachDB
CockroachDB is a distributed SQL database designed for cloud-native applications with automatic sharding, multi-region replication and PostgreSQL wire compatibility. The CockroachDB Serverless tier provides 10 million free Request Units per month for small workloads. The Standard plan starts at approximately $0.50 per hour per node. CockroachDB guarantees serializable isolation by default, the strongest isolation level, and provides automatic failover without manual intervention when individual nodes fail.
Pros
- +Automatic horizontal scaling and multi-region distribution without manual sharding or rebalancing logic
- +Strong consistency with serializable isolation as the default setting for correct transaction processing
- +PostgreSQL-compatible wire protocol: existing tools, drivers and ORMs connect and work without changes
- +Serverless tier available with 10 million free Request Units per month suitable for development workloads
Cons
- -Higher latency for single-node queries compared to standalone MySQL or PostgreSQL due to consensus overhead
- -More complex operational debugging for smaller deployments where distribution is not actually needed
- -Costs escalate quickly for larger workloads: the Standard plan is significantly more expensive than managed MySQL
Comparison at a glance
PostgreSQL offers the richest feature set with JSONB, CTEs, materialized views and over 1,000 extensions. MariaDB is the safest migration choice as a drop-in replacement with bonus features. PlanetScale delivers serverless MySQL branching powered by Vitess for teams needing horizontal scaling. SQLite fits perfectly for embedded, edge and local applications, while CockroachDB provides distributed SQL with automatic multi-region replication.
What to consider when switching?
- Check whether your ORM, stored procedures and application code are compatible with the target database dialect
- Compare performance benchmarks for your specific query patterns, write volumes and concurrency requirements
- Evaluate available managed hosting options, associated costs and SLA guarantees for each platform
- Assess the total migration effort including stored procedures, triggers, views and application code changes
Which alternative does MG Software recommend?
At MG Software, we recommend PostgreSQL as the default MySQL alternative thanks to its richer feature set, active independent community and complete absence of licensing risks. For teams that strictly require MySQL compatibility, MariaDB offers the safest migration path with minimal code changes.
Frequently asked questions
Related articles
Leaving PlanetScale after the free tier ended? SQL alternatives
PlanetScale killed its free tier and restricts open-source MySQL features. Neon offers free serverless Postgres with branching, Supabase adds auth and storage.
PostgreSQL vs MySQL: Which Database Should You Choose?
The database you choose determines how your app scales. PostgreSQL and MySQL compared on advanced features, performance, and extensibility.
MongoDB Alternatives When Your Document Database Stops Scaling Affordably
Rising Atlas costs and schema flexibility working against you. Five databases that structure your data better without vendor lock-in.
Firebase Alternatives That Give You More Control Over Your Backend
Firebase is convenient, but vendor lock-in and unpredictable pricing push teams away. Compare Supabase, Appwrite, PocketBase and more on features, cost and freedom.