Supabase vs Heroku Postgres
4 minute read
What is Heroku Postgres?
Heroku is a cloud application platform that offers managed PostgreSQL as a service. They offer 5 levels of Postgres support from the Hobby Tier up to the Shield Tier, each with different levels of features and pricing. Heroku announced that starting November 28, 2022, they will stop offering free product plans and will shut down free dynos and data services. Since the announcement, developers started migrating their projects to Supabase.
What is Supabase?
Supabase also offers managed Postgres, the main difference is that with each deployment you also get:
- Auto-generated API - never write an API again
- Realtime - subscribe to data changes via websockets
- Auth - users can log in and out of your application
- Functions - deploy custom logic to the edge
- Storage - serve large files and folders
- PgBouncer - connection pooling useful for serverless computing
How are they similar?
Heroku Postgres and Supabase both offer:
- A web UI for managing your instance
- SLAs and Enterprise-grade support packages
- Direct SSL connections to Postgres
- Postgres Extensions (see Supabase Extensions, Heroku Extensions)
- Backups and PITR
- Postgres logs
What are the differences?
These are some of the key differences between Heroku Postgres and Supabase in terms of features:
- Supabase is more than just the raw database, it also comes with:
- Connection pooling so that you won’t run out of connections in a serverless environment.
- Auto-generated APIs based on your schema, so you can communicate with your database directly from the client.
- Realtime API is useful for when you want to subscribe to changes to your database over websockets.
- Auth API can be used to leverage Postgres’s Row Level Security model, and control access to sensitive data on a per user, or per group level.
- Functions can be deployed out to the edge directly from the Supabase CLI, which means you can run sensitive business logic or transformations in a serverless fashion.
- File Storage is useful for when your app needs to store large files and folders that aren’t suitable for storing within Postgres itself.
- A spreadsheet-like web interface for building your schemas and inspecting data.
The two services price quite differently, the key differences being:
- Supabase pricing is based around usage, so you only pay for what you use.
- Heroku prices based on a tier model with 37 plans to choose from.
Supabase’s free plan also includes a dedicated Postgres instance, and the best bit is you can upgrade to pro later without any interruptions.
You may have strict data regulations that you must comply with, so choosing your region can be very important. Here’s how the deployment options stack up:
- Supabase can be deployed to any one of 12 data centers across the globe (free plan included).
- Since Supabase is fully open source - you can also self host wherever you like.
- You can deploy Heroku Postgres to two data centers (US and Europe) however 6 more data centers are available on the Enterprise plan.
How to migrate from Heroku Postgres to Supabase
Migrating is surprisingly simple. You just need to use the standard Postgres
psql tools to export your Heroku database and import to Supabase. We created a handy guide for migrating from Heroku to Supabase.
Supabase vs Firebase
26 May 2022