PlanetScale vs. Neon: the Continued Saga between MySQL and PostgreSQL
Bytebase - Database CI/CD and Security at Scale
Leading open source database DevSecOps solution for Developer, Security, DBA, and Platform Engineering team.
Hi and welcome to Database DevOps Academy #8!
Each week, we share Database DevOps insights and best practices for modern engineering organizations. If you enjoy this newsletter, we ask you to subscribe and share. ??
In this Issue, we are looking at the great battle of MySQL against Postgres Vol.2: PlanetScale vs. Neon. Enjoy!
The?2023 Stack Overflow survey?shows that PostgreSQL has taken over the first place spot from MySQL and become the most admired, desired database.
It seems that the love-hate relationship between MySQL and PostgreSQL will never end. From vanilla MySQL vs. PostgreSQL to distributed TiDB vs. CockroachDB, to cloud-native AWS Aurora vs. GCP AlloyDB, and now we are entering the next chapter, the serverless, developer-oriented PlanetScale vs. Neon.
At Bytebase, we work with the MySQL / PostgreSQL ecosystems extensively. Our founders also build?Google Cloud SQL, one of the largest hosted MySQL & Postgres cloud services.
Below we give an extensive comparison between PlanetScale and Neon from the following dimensions:
Architecture
PlanetScale is a distributed database based on?Vitess. Vitess is a shared-nothing architecture where each shard contains a MySQL primary node and set of replicas. VTGate proxy routes the application request to the respective shard.
Neon is a shared-storage architecture. It separates the compute and storage. The compute part is just a normal PostgreSQL server, the storage part is a custom-built multi-tenant storage system shared by all Postgres compute nodes.
Compatibility
PlanetScale's MySQL compatibility?is constrained.
Neon is?mostly compatible?with vanilla PostgreSQL.
Neon rebuilds the paging layer and just lightly changes the Postgres codebase. Neon's compatibility is only constrained by its cloud operating model, which are similar to other hosted database services (no superuser or host file system access).
Developer Workflow
Both PlanetScale and Neon are targetting developers, telling the same developer workflow story in different ways.
PlanetScale's story emphasizes the end-to-end experience, from branching to schema migration, monitoring, and revert.
Neon's story highlights the single branching feature. Their purpose-built paging layer has copy-on-write (CoW), which makes branching instantaneous and cost-effective.
Reliability
Shared-nothing architecture is inherently fault-tolerant as data is sharded and replicated. Vitess is a proven technology used by logos across the globe. PlanetScale has also demonstrated its reliability by not having notable outages for years.
Shared-storage architecture requires more engineering effort to make the logical SPOF storage component fault tolerant. Neon details the work in?its architectural decisions.
As a database trailblazing new architecture, Neon's advantage is it sits on a solid foundation. PostgreSQL itself is rock solid and fully transactional. Neon's Pageserver approach also aligns perfectly with the WAL-based logging in PostgreSQL. Neon is also able to use Rust, a more suitable system language to implement its storage layer.
Scalability
PlanetScale, as its name suggests, is planet-scale—the shared-nothing architecture grants near-linear scalability?up to 1 million QPS. The underlying Vitess is originally developed inside YouTube to handle scalability challenges and it's been battle-tested in other large internet companies (1,?2).
Neon can not scale as much as PlanetScale. After all, it's a single-node PostgreSQL instance. But this single node can scale up quite well. Neon separates the storage and compute, thus each can scale individually. And in the cloud, storage is infinite, compute is abundant, only the network bandwidth is constrained. The separated architecture also infers elasticity, scale-to-zero is as easy as scale-up.
Operability
PlanetScale provides a completely managed database solution. It tries to take care of?every aspect of using the database.
领英推荐
It's quite a lot to cover and PlanetScale manages to craft every pixel. e.g.?Boost?shows PlanetScale's strength to transform an?academic paper?into a polished product.
Neon is relatively new and provides essentials.
The SQL Editor is handy. Here Neon embeds an external view from?explain.dalibo.com?to display the query plan. It looks a bit strange visually but serves the purpose well.
Integration
PlanetScale itself is already a comprehensive database platform. Its?doc site?also lists a handful of standard database integrations:
Neon hasn't accumulated many standard database integrations yet. But Neon's unique capabilities unlock new integration frontiers:
Compliance
PlanetScale has?SOC 2 Type 2 and HIPAA. Neon has completed?SOC 2 Type 1?so far.
Open Source
PlanetScale and Neon choose an identical strategy, open-soucing their database codebase under the same liberal license and only charging the cloud service.
PlanetScale is based on a?Vitess fork?under Apache-2.0. The team once built?gh-ost, the best online schema migration tool for MySQL and probably among all open-source RDBMS. They also open sourced?beam, a message board web app to showcase PlanetScale.
Neon also?open sources?its entire database codebase under Apache-2.0 license.
Pricing
PlanetScale employs a usage-based pricing on row reads/writes. This is atypical for a database service and raises?controversy. On one hand, it brings extra incentive for people to optimize queries, on the other hand, bad queries are inevitable and MySQL query optimizer is also?flawed. To offset this concern, PlanetScale recently introduced a new?Scaler Pro tier?for unlimited row reads/writes.
Neon offers a usage-based pricing based on 4 metrics:?active compute time,?data storage,?data transfer out?and?data written. This pricing model is more traditional and predictable. Neon also provides a pricing calculator to estimate the cost.
Funding
Both are well-funded companies led by industry veterans. PlanetScale has raised $105M so far, while Neon nabs $103M (including a very recent?$46M series B).
PlanetScale or Neon
Overall, PlanetScale provides a cohesive experience for every database task. Originally, it was a hosted MySQL-compatible Vitess service only for hyperscalers. Since?pivoting to developers, PlanetScale has transformed into an advanced serverless database platform that happens to speak the MySQL dialect.
Neon debuted later and has a similar value proposition to the new PlanetScale. Unlike PlanetScale, Neon knows its targeting audiences from day 1, and purposefully builds the technology catering to them:
Beyond PlanetScale and Neon
Today, when choosing the database system for your next project, the very first thing to consider is no longer between?Postgres vs. MySQL. Instead, it's whether to choose RDBMS or other genres. RDBMS still dominates the database market by shares, however, ironically, this space doesn't advance as much as other database segments in the cloud era. Customers do have?a plethora of choices, but none is coming close to MongoDB Altas for NoSQL or Snowflake for OLAP.
PlanetScale and Neon are similar to each other, they are also similar to MongoDB / Snowflake:
PlanetScale and Neon could become the next MongoDB / Snowflake for modern RDBMS database-as-a-service (DBaaS). We've all been waiting too long for this.
If you still stick with vanilla MySQL/Postgres and want PlanetScale's database change workflow or Neon's visual SQL Editor, please check out?Bytebase. Bytebase is a database tool for all mainstream databases, covering database change, query, security, and governance all-in-one. It provides a more customizable?change workflow?and visual?SQL Editor?integrated with?access control?and?data masking.