DEV Community

Cover image for Cost Comparison: Neon vs. Azure Database for PostgreSQL Flexible Server
Bobur Umurzokov
Bobur Umurzokov

Posted on

Cost Comparison: Neon vs. Azure Database for PostgreSQL Flexible Server

A few days ago, I spun up a database in Azure for testing. After running the tests, I closed the connection, as I am used to working with tools like Neon.

Today, I opened up Azure again.

Cost Comparison: Neon vs. Azure Database for PostgreSQL

Oops. Having become accustomed to the scale-to-zero database world, I forgot that there are actual costs associated with keeping services running.

This was with SQL Server, but the same applies to other Azure databases, such as Azure Database for PostgreSQL Flexible Server. Traditional cloud databases are instance-based—once set up, they keep running, and costs need to be considered from day 1, not only for how your deployment looks right now but also for how it will scale.

What are those costs? In this article, we’ll compare the costs for different use cases of Azure Database for PostgreSQL Flexible Server and Neon, a new serverless database now available in the Azure portal.

In Neon, things work differently, as instances are not provisioned in the same way as they are with the Flexible Server: Neon implements usage-based billing, scaling storage, and computing automatically according to usage, all the way down to zero. How does this affect the monthly bill? Let’s find out.

Understanding the options in Flexible Server

We’ll start with a brief overview of the options available on Azure Database for PostgreSQL Flexible Server. They have three types of Postgres machines:

  • Burstable: Best for workloads with flexible computing requirements, offering the most economical options. These instances are for development, testing, and light production workloads.
  • General Purpose: Designed for most business workloads requiring balanced computing and memory with scalable I/O throughput. These instances range from 2 to 96 vCores with a memory-to-core ratio of 4:1, making them suitable for typical production databases.
  • Memory-Optimized: Engineered for high-performance database workloads requiring in-memory performance for faster transaction processing and higher concurrency. These instances offer twice the memory per vCore compared to General Purpose, making them ideal for memory-intensive applications.

The pricing for Azure Database for PostgreSQL Flexible Server scales within each of these options with the size of the machine in terms of cores and memory. For instance, the cheapest Burstable option is a B1ms with one vCore and 2GiB of memory for $12.41/month. The most expensive Burstable is the B20ms with 20 vCores and 80GiB for $992.80/month. The top end of options is an E96ads v5 AMD memory-optimized machine with 96 vCores and 768GiB memory. That can be yours on a pay-as-you-go plan for $8,760/month (you can reduce this cost through either 1- or 3-year reserved pricing).

That is expensive–but it might be what you need. The goal here isn’t to make you always choose Neon; it is to give you a true comparison between the two Postgres services now available on Azure. With Azure, you also pay for storage independently:

  • $0.115/GiB/month
  • $0.05/IOPS/month

Understanding Neon’s pricing

Neon’s pricing is different than Flexible Server. It is based on a subscription model that includes a certain level of resources within a flat fee, with any usage beyond that flat fee being billed additionally:

  • Free Plan ($0/month): For kickstarting projects. Users get 10 projects, 0.5 GB storage, and 190 compute hours. They can autoscale up to 2 vCores and 8 GB RAM.
  • Launch (From $19/month): For launch products. Users can have up to 100 projects and 10 GB storage. 300 compute hours are included and instances can scale to 4 vCores and 16 GB RAM. Additional compute hours are billed at $16 per compute hour.
  • Scale (From $69/month): For scaling production workloads. Up to 1000 projects, 50 GB storage, and 750 compute hours. Autoscaling up to 8 vCores and 32 GB. Additional compute hours are billed at $16 per compute hour.
  • Business (From $700/month): For larger workloads. 5,000 projects, 500 GB storage, and 1000 compute hours Autoscaling up to 16+ vCores. Additional compute hours are billed at $16 per compute hour.

There are also custom enterprise plans with higher resource limits, dedicated requirements, and annual contracts.

Key differences between Neon and Flexible Server

  • Provisioning: Due to the separation of storage and compute, Neon can instantly “provision” new projects without the need to allocate storage and compute in advance.
  • Scale-to-zero: Neon only charges for actual compute usage and can scale to zero, meaning no charges when not in use. Flexible Server charges for the full instance time regardless of usage. Although you can stop Flexible Server databases on-demand, they won’t stop automatically and will restart after seven days.
  • Autoscaling: Neon includes built-in autoscaling for both storage and computing, which automatically adjusts resources based on demand.
  • Management: Neon supports multiple projects within its plans, and each project is logically equivalent to an instance but much easier to manage. These projects are API-first and lightweight, making them simpler to handle compared to traditional instances.

Let's work through real-life scenarios to see how each option compares.

Small MVP project

Let’s start with a common scenario. You are an early-stage startup building an MVP. You need a small database (<0.5GB) for a development and testing workload. As you build, you have an intermittent usage pattern and want to take advantage of modern PostgreSQL features.

With Neon, the free tier is going to work for you. The Neon Free Tier provides:

  • 10 projects
  • Up to 0.5GB storage
  • 190 compute hours/month (equivalent to ~6.3 hours/day with 1 CU)
  • Read replicas
  • 90+ Postgres extensions

In this case, the perfect usage pattern would be development during business hours (8-10 hours/day) with the database auto-scaling to zero overnight. Without overages, you can probably squeeze in a bit of weekend development, and if you are careful with computing hours, you can start running a small production workload.

In contrast, Azure Database for PostgreSQL Flexible Server has no free tier, so you will pay immediately. A similar machine, available on the Neon free tier with two vCores and 8GB memory, costs $100. You would also need to pay even when the database is idle, and this option lacks branching capabilities.

Let’s move on to that scenario next.

Development team

Let's consider a typical development team scenario. You have 10 developers, each needing their own database copy for feature development. Every developer needs to work independently without affecting others' work.

With Neon, the Launch plan at $19/month would cover this well. You get:

  • 100 projects and multiple branches per project
  • 10 GB storage (shared across branches)
  • 300 compute hours/month
  • Up to 4 CU (vCores) when needed

The magic here is that each developer can create branches as needed, work on them during their shift, and let them scale to zero overnight. The compute hours are shared, so you could support the whole team within the included hours by carefully managing the scaling to zero. The total cost is $19/month.

Flexible Server requires a different approach since you need separate databases. You'd need ten B2ms instances (2 vCores, 8GB RAM) at $99.28/month each, plus storage costs for each copy (20GB × 10 copies × $0.115/GB = $23/month). The databases keep running unless manually stopped; you're looking at around $1,015.80/month minimum. This is more than 50X the cost of Neon. (Basically, this is a very bad way to use Flexible Server).

Production SaaS Application

Now, let's examine a typical production SaaS scenario. To support your growing user base, you need a robust setup with four cores, 16GB RAM, 100GB storage, and 24/7 operation.

With Neon's Scale plan ($69/month), you get:

  • 1000 projects
  • 50 GB storage included
  • 750 compute hours baseline
  • Autoscaling up to 8 CU

Running continuously at 4 CU would typically use 2,880 compute hours per month (4 × 24 × 30), surpassing the included hours by 2,130. Factoring in overages and additional storage, the total cost would typically reach around $350/month.

However, this overlooks some unique Neon advantages. For example, Neon's autoscaling can adjust resources during quieter periods, reducing compute costs significantly if the 4 CU capacity isn't required around the clock. Additionally, with Neon’s branching, many ephemeral development and testing environments can be managed as rather than separate instances, which would need to be added to the bill in Flexible Server.

Flexible Server’s D4ds v5 (4 vCores, 16GB RAM) is priced at $259.88/month on a pay-as-you-go basis, or $155.99/month with a one-year commitment. Including storage costs (100GB at $0.115/GB), the total justin for the production instance would be approximately $271/month pay-as-you-go or $167/month with the reserved plan.

While at a surface level, Neon might seem slightly more expensive, autoscaling and branching would most likely make Neon more affordable in the long run and when looking at a complete deployment.

Multi-tenant Application

Let’s cover a complex multi-tenant setup, where each tenant requires a dedicated environment. This scenario requires significant resources: eight cores, 32GB RAM, 500GB storage, and continuous high availability.

Neon offers a serverless architecture that can accommodate a database-per-customer design with instance-level isolation by creating one project for every customer. Under Neon's Business plan at $700/month, here's what the structure could look like:

  • Included in the Business Plan:
    • 5,000 projects
    • 500 GB of total storage
    • 1,000 compute hours
    • Autoscaling up to 16+ CU
    • High availability and compliance features

Let’s assume each tenant uses 1 CU (2 vCores, 8GB RAM) for 8 hours per day, resulting in 240 hours per month per tenant. With 100 tenants, this totals 24,000 compute hours per month. Each tenant requires 5 GB, totaling 500 GB for 100 tenants. In Neon, this would mean a compute overage bill of 23,000 hours x $0.16/hour = $3,680 on top of the $700 base fee. This makes $4,380 /month total.

In Flexible Server, if we wanted to reproduce this setup with B2ms machines (2 vCores and 8GB RAM), this would cost us $99.855/month per tenant. For 100 tenants, we’d be looking at $9,985.50 per month, double than of Neon’s–plus a lot more management work.

Conclusion

Neon offers a serverless architecture that only charges for actual usage, which makes it cost-effective and easy to manage for many use cases. The best is to experience by doing this: visiting the Azure Marketplace and deploy a free Neon database.

Top comments (0)