🔒 Secure-first SQL Editor with data access control and masking 🎭

Industry

PlanetScale vs. Neon: the Continued Saga between MySQL and PostgreSQL

Tianzhou
Tianzhou13 min read
PlanetScale vs. Neon: the Continued Saga between MySQL and PostgreSQL

The 2023 Stack Overflow survey shows that PostgreSQL has taken over the first place spot from MySQL and become the most admired, desired database.

stackoverflow

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.

planetscale

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.

vitess-arch

Neon is a shared-storage architecture. It separates the compute and storage. The compute part is just normal PostgreSQL server, the storage part is a custom-built multi-tenant storage system shared by all Postgres compute nodes.

neon-arch

Compatibility

PlanetScale's MySQL compatibility is constrained.

  1. Underlying Vitess limitations. Vitess shared-nothing architecture carries inherent compatibility limitations. Features requiring session maintenance or cross-shard coordination are challenging to implement.

  2. Product trade-off. e.g. To support online DDL, PlanetScale disallows foreign keys entirely, which is more strict than Vitess' FK limitation.

  3. Cloud operating model. No super privilege or LOAD DATA INFILE to access the host file system.

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, and they are 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.

planetscale-workflow

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.

neon-branch

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 proved its reliability for not having notable outages for years.

vitess-user

Shared-storage architecture requires more engineering effort to make the logical SPOF storage component fault tolerant. Neon details the work in its architecture 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 complete managed database solution. It tries to take care of every aspect of using the database.

planetscale-tech

  • Deploy requests and Branches for database change workflow.
  • Insights for monitoring.
  • Boost for speeding up query performance.
  • Revert for reverting the change.
  • Console for mysql CLI experience in the browser.
  • Backup for disaster recovery.

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.

planetscale-boost

Neon is relatively new and provides essentials.

  • Disaster recovery is provided by its branching feature.
  • A visual SQL Editor to interact with the database.

neon-sql-editor

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:

  • Application frameworks from major languages.

  • Monitoring with Datadog.

  • Data transfer via Airbyte, Stitch, Hightouch.

Neon hasn't accumulated many standard database integrations yet. But Neon's unique capabilities unlock new integration frontiers:

  • Snaplet uses Neon to instantaneously prepare production database snapshots for the testing environment.

  • Replit leverages Neon's scale-to-zero to offer its users a minimum-cost database service.

  • Vercel pairs with Neon's database branching to provide a realistic preview deployment in minutes instead of hours.

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.

Star History

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.

planetscale-pricing

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.

neon-pricing

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

PlanetScaleNeon
ArchitectureShared-nothing, sharded compute and storage unitShared-storage, separated compute and storage
CompatibilityLimited by the underlying shared-nothing architectureNear-compatible
Developer WorkflowEnd-to-end experienceInstantaneous and cost-effective branching
ReilabilityProven technology with track recordNew architecture on a solid foundation
ScalabilityScale out to near infiniteScale up to an extent, scale-to-zero elasticity
OperabilityComprehensive, polished toolingEssential, pragmatic tooling
IntegrationTypical database integrationsNovel integrations enabled by instant branching and elasticity
ComplianceSOC 2 Type 2, HIPAASOC2 Type 1
Open SourceClose-sourced paid cloud service; Open-sourced database under Apache-2.0Close-sourced paid cloud service; Open-sourced database under Apache-2.0
PricingRow reads/writes + storage + HAComputation + storage + data transfer
Funding$105M$103M

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 very similar value proposition as the new PlanetScale. Unlike PlanetScale, Neon knows its targeting audiences from day 1, and purposefully builds the technology catering to them:

  • Git-like branch management, in particular, the instant branching including both schema and data.
  • Serverless database with autoscaling up and down.
  • Embrace the rise of Postgres and maintain near-perfect Postgres compatibility.

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:

  • Like MongoDB, PlanetScale uses shared-nothing architecture, provides a comprehensive database platform, is developer obsessed, and tells great product stories.

  • Like Snowflake, Neon brings the novel shared-storage approach to the staggering OLTP architecture, uses Postgres dialect, and also values developer experience.

Both 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.


BTW, 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 more customizable change workflow and visual SQL Editor integrated with access control and data masking.

change-query-secure-govern-database-all-in-one

Further Readings

Jointhe community

At Bytebase, we believe in the power of collaboration and open communication, and we have a number of communities that you can join to connect with other like-minded.

Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.