Neon: Does Going Serverless Solve Fixed Expenses for Postgres?

Comparison with competitors. Cost analysis included.

alexeylark
10 min readApr 25, 2024

Introduction

Serverless architectures have been around for quite a while now, offering the ability to abstract away infrastructure management tasks and enabling automatic scaling, high availability, and fault tolerance.

Most importantly serverless architecture usually follow a pay-per-use pricing model. This means that you only pay for the actual consumed resources, rather than for idle resources. This cost optimization is especially beneficial for applications with unpredictable or variable workloads.

Yet, probably due to the high requirements for relational OLTP databases, that must assure transactional integrity coupled with low-latency concurrent data access, serverless solutions are still considered an innovation in that domain.

Recently, serverless Postgres platform Neon went out of Technical Preview, and comes with a bold statement to provide fully managed Postgres with a free tier, scale-to-zero capability, while being able to start a compute node from an idle state in under 1 s, to scale up to a more powerful node in ~100 ms (with no disruption), and to have virtually “bottomless” storage sitting on S3.

This is an ambitious claim, but the pricing suggests monthly paid plans with some variability on top. As much “unserverless” as it sounds, this is fairly standard among serverless database offerings, so let’s dig in how Neon pricing works and how it fares with the competition.

Competition:

  1. Google Cloud SQL (managed Postgres)
  2. Neon (serverless Postgres)
  3. AWS Aurora Postgres (serverless Postgres)
  4. PlanetScale (serverless MySQL)

Overview of the services

1. Google Cloud SQL

Google Cloud SQL is a traditional managed database (like AWS RDS), with the ability to scale the compute up and down on command with downtime measured in minutes. The storage can increase automatically, but with no option to scale down. One other consideration is that the storage capacity directly affects the storage performance both in MB/s and IOPS.

Compute starts from shared-core at ~1/8 of the full node and 0.61 GB RAM at at $0.013 per vCPU/hour.

Storage is priced at $0.17 per GB-month and starts from 10 GB.

Default dedicated-core nodes come from 1 vCPU at $0.041 per vCPU/hour, and 4 GB RAM at $0.007 per GB/hour with separate vCPU and RAM billing.

2. Neon

Neon offers a free tier and two pre-defined tiers (the ones which don’t require contacting sales) with fixed pay and additional per-usage pricing on top.

Free-Tier has fixed 0.25 vCPU, 1 GB RAM, and most notably just 0.5 GB of storage. The storage plays the biggest limiting factor here, although it’s perfectly sufficient for really small projects, and again, it’s totally free and it can scale once we decide to pay.

Paid Tier “Launch” — comes at $19, has up to 4 vCPU and 16 GB RAM, with 300 vCPU-hours included in the plan monthly. Plan features 10 GB of storage included, with a price of $3.50 per extra 2GB/month.

Another paid tier “Scale” — coming at $69, doubles the maximum compute, ups the included vCPU-hours to 750 hours, and increases the included storage to 50 GB. Also, additional storage is paid at $15 for extra 10 GB/month, which is lower per-GB, than on Launch tier.

On both paid tiers we are charged additional $0.16 per extra vCPU/hour, while free tier has enough vCPU-hours to cover all month of use at it’s capacity of 0.25 vCPU.

Everything higher, including the promised “bottomless” storage and customer-owned S3 is custom-rated and requires contacting sales.

The database is also available as a self-managed solution, as the company’s product is fully open-source.

3. AWS Aurora v2:

Aurora Serverless v2 scales compute and memory capacity as needed, with no disruption to client transactions or your overall workload. The ability to use reader DB instances with Aurora Serverless v2 helps you to take advantage of horizontal scaling in addition to vertical scaling.

Compute capacity is measured in ACUs, which are set to be roughly 1 vCPU + 2 GB RAM, with ACU-hour cost of $0.16.

Storage costs $0.225 per GB-month.

Scaling happens in increments of 0.5 ACUs, with a minimum capacity fixed at 0.5 ACU (no scale-to-zero). There are other considerations to the recommended minimum size of the compute node in Aurora, like the maximum number of connections and the speed of scaling up to the higher capacity, but let’s keep it brief. I’ve chosen the more expensive I/O optimized version to keep parity with other solutions not billing per I/Os.

4. PlanetScale

Following the recent deprecation of a free tier “Scaler” and leaving users with “Scaler Pro” — a set of predefined compute packages, the company’s pricing is probably the most consise and simple of the bunch.

At the same time, the pricing model doesn’t reflect the “serverlessness” of the solution, and the pay-per-usage approach is used only for testing or development branches (where it’s probably most needed, to be fair). The biggest difference compared to a managed database like Google Cloud SQL is the ability to scale without downtime, and the existence of branches.

Starting from 1/8 vCPU at $39, and increasing the maximum size of the node by doubling it, PlanetScale has a non-linear pricing up to 1 vCPU, where the price reaches $179. After that the price starts to double, being in linear dependence with received capacity up to 8 vCPU, when more vCPU/RAM ratios become available to the customer. 10 GB of storage are included in each plan by default, with extra 1 GB/month costing $1.5.

PlanetScale is a MySQL-only platform, and is added here for reference. At the same time both Google Cloud SQL and AWS Aurora have their MySQL versions, so the comparison has it’s place.

Cost breakdown

I decided to compare two compute configurations, which should cover the lower end of the spectrum:

  1. The smallest compute possible (<1 vCPU) + min storage;
  2. Average compute (~4 vCPU + 16 GB RAM) + 100 GB storage.

Each solution uses SSD and is located in a single region (US-Ohio), for exception of PlanetScale that is deployed in 3 regions by default.

A lot of things are not taken into account in the comparison, for example the impact of RAM and storage size on performance, backup costs etc.
Still, I think, this comparison could be valueable as a rough estimate.

1. Google Cloud SQL

1. Minimal config: shared-core 1 vCPU + 0.61 GB RAM + 10 GB storage.

  • Compute is at $0.013 per node: $0.013 x 24 x 30 = $9.3 / month;
  • Storage is at $0.17 per GB-month: $0.17 x 10 = $1.7 / month;

Total cost monthly: $11.

2. Average config: dedicated core 4 vCPU + 16 GB RAM + 100 GB storage.

  • Compute is at $0.041 per vCPU/hour + $0.007 per GB/hour: ($0.041 x 4 + $0.007 x 16) x 24 x 30 = $199 / month;
  • Storage is at $0.17 per GB-month: $0.17 x 100 = $17 / month;

Total cost monthly: $216.

2. Neon

1. Minimal config: 0.25 vCPU + 1 GB RAM + 0.5 GB storage (free-tier)

Free tier has no time limit on vCPU-hours, which is equal to 0.25 x 30 x 24 = 180 vCPU hours included. To have 10 GB of storage we would need to pay for the Launch tier at $19, which would also increase compute capacity.

Total cost monthly: $0.

2. Average config: 4 vCPU + 16 GB RAM + 100 GB storage.

Compute is enough in Launch Tier at $19, with time limit of 300 vCPU hours. With 4 vCPU at maximum capacity all month we would need 4 x 24 x 30 = 2880 hours. To add that we need to pay $0.16 per vCPU/hour, which translates to $0.16 x (2880–300) = $413.

10 GB of storage is included in the Launch Tier, with $3.5 / 2 GB for additional space. This would cost $3.5 x 90 / 2 = $158 for 100 GB.

With these costs the monthly bill would be $177 — $590, and at that point it makes sense to take the Scale tier at $69, that doubles the compute, but most importantly has 750 compute hours and 50 GB storage included, and also features reduced pricing on additional storage at $15 / 10 GB.

  • Compute-hours for a month of 4 vCPU: $0.16 x (2880–750) = $340/month;
  • Additional storage would cost $15 x 50 / 10 = $75;

Total cost monthly: $144 — $484.

3. AWS Aurora

1. Minimal config: 0.5 ACU + 10 GB storage

  • Compute comes at $0.16 x 0.5 x 24 x 30 = $58
  • Storage costs $0.225 x 10 = $2

Total cost: $60.

2. Average compute: 0.5–4 ACU + 100 GB storage

Max compute power comes should be on par at 4 ACU, which is roughly 4 vCPU with 8 GB RAM. Considering the lower amount of RAM, that value may need to be increased to achieve parity with other solutions. 100 GB is paid separately.

  • Compute costs: $0.16 x 4 x 24 x 30 = $464;
  • Storage costs: $0.225 x 100 = $23;

Total cost: $81 — $487.

4. PlanetScale

1. Minimal config: 1/8 vCPU + 1 GB RAM + 10 GB storage

PlanetScale has the Scaler Pro tier coming from $39, that includes the minimal compute PS-10 with 1/8 vCPU + 1 GB RAM, and 10 GB storage.

Total cost: $39.

2. Average compute: 2 vCPU + 16 GB RAM + 100 GB storage.

Leaving aside the fact that we’re comparing apples and oranges here, including a MySQL solution into a Postgres comparison, I’m also not quite sure of which nodes would be at least somewhat equal in terms of compute capacity. For example, each node in PlanetScale has a vCPU/RAM ratio of 1/8, whereas for Postgres solutions it’s 1/4–1/2.

Having no reference to compare Postgres and MySQL, and features as 2 read replicas in other regions, the test configuration definition is tough. I decided to take a smaller compute with 2 vCPU and the same 16 GB RAM costing $349, with 10 GB of storage included. The next tier with 4 vCPU and 32 GB RAM would cost massive $699 just for the compute.

Storage costs $1.5 / GB on top of 10 GB that’s included in the plan.

For 100 GB that’s $1.5 x 90 = $135.

Total cost: $484.

Comparison conclusions

1. Minimal config

For a minimal instance possible the win goes to Google Cloud SQL and Neon, with Neon offering a free tier for database sizes up to 0.5 GB, and Google Cloud SQL having the least expensive option in 10 GB configuration. Both AWS Aurora and PlanetScale would cost 2X-6X times more in a minimal configuration, without the scale-to-zero capability.

1. Minimal config

2. Average config

For a more powerful configuration a managed solution again proved it’s cost efficiency, with Google Cloud SQL being ~2 times cheaper than serverless databases (under constant load around it’s maximum capacity).

Neon and AWS Aurora are in close competition with each other, with Neon offering better compute for the price, and Aurora having cheaper storage.

2. Average config

Final Thoughts

In theory, serverless solutions offer a different pricing model, that is based on usage. They are the most cost-effective when the usage is small and irregular. Though, we can see that even the smallest and average instances don’t always have the edge in pricing when compared with a regular managed database service. Plus, true pay-per-usage pricing model must account for persistent storage, so fixed costs of $0 can exist only as a marketing strategy.

In the end, each solution has it’s strong sides and weaknesses with different pricing models for each option:

  1. Google Cloud SQL has very competitive pricing on small instances, and a good value proposition for databases with stable load and constant increase in database storage. Best pricing for databases with a lot of storage, that’s not going to be cut down (cutting down storage would literally require moving to another instance).
  2. Neon offers a free tier, and great compute performance with minimal fixed costs on paid plans. It’s ability to scale at a very fast pace would make it shine on instances with high requirements for peak load. It’s priced very competitively to other serverless solutions, offering a more capable compute, but having higher storage costs than Aurora. Modern features like branching also add to the value proposition.
  3. AWS Aurora has the biggest cost to the minimal configuration, but it is able to show a good overall solution with usage-based pricing model for an average compute. It is slower to scale than Neon, but it’s still able to scale without downtime, and it’s cheaper on storage, which would start to be an advantage over Neon after ~100 GB.
  4. PlanetScale has the highest compute and storage costs. At the same time it comes with some additional features, targeting growing startups, such as branching (also available on Neon), and multi-region from the get-go. The pricing doesn’t follow the pay-per-usage approach for the main compute, and can be justified only if you make use of the features in the package. A MySQL platform with all it’s pros and cons.

If you’d like to share an opinion, feel free to write it in the comments or send me a message on LinkedIn. I’d love to hear any feedback.

Links:

  1. Google Cloud SQL: Pricing — Cloud SQL For PostgreSQL
  2. Neon: Neon — Serverless Postgres Pricing
  3. AWS Aurora: Amazon Aurora Pricing — AWS
  4. PlanetScale: PlanetScale plans

--

--