An Introduction to Supabase: The Open-Source Alternative to Firebase

An Introduction to Supabase: The Open-Source Alternative to Firebase

·

5 min read

What is Supabase?

Supabase is an open-source platform that provides Backend-as-a-Service (BaaS). Supabase provides SDK for platforms like web, and mobile (Android & IOS) that helps you speed up the development process and manage all the services you will need for the development.

Supabase is developed to help developers to set up their backends in minutes, living up to their slogan "Build in a weekend, scale to millions".

Supabase vs Firebase

Supabase is marketed as "Supabase is an open-source Firebase alternative" let's see how true it is.

Keep in mind Firebase is now mature enough while Supabase is still in its infancy. Firebase has got years of updates and support from the biggest tech giant in the industry Google. While supabase was launched in 2020 has a long way to go.

The one big advantage that Supabase has is it only uses open-source technologies, which means you can run Supabase with docker and self-host it on AWS, and Digital Ocean which means you are free from vendor lock-in, unlike Firebase that uses its priority technologies like Firestore that locks you to with the platform.

There is much more to compare between Supabase and Firebase, let's save this topic for another post and focus on the Supabse here.

Supabase Features

1. Database

Supabase uses Postgres SQL which is an open-source relational. Supabase makes it easier to use SQL databases, Supabase database scales up with no extra effort it manages all the things on its end and it comes with a dashboard and SDK that makes it much easier to use it.

On creating a new project it creates a table with it, Using the database dashboard you can start adding tables and columns to it. Supabase will update the schema and will handle migrations for us in the background. The dashboard helps us to visualize the data and makes it easier to manage it.

The API tab of Supabase provides you with an easy way to integrate the database. The documentation there is specifically generated for your database, the API documentation is auto-generated so if you change something in the database the documentation will update too.

Instead of writing raw SQL code in your project, you can use Supabase SDK which allows you to access your data in a DSL, you can use simply write the query if you want to access the data instead of writing a full join.

Supabase also provides you with an SQL editor where you can write queries and run them, it also provides you with full-text search, unlike Firestore, which also provides you Triggers and Extensions.

2. Auth

Authentication is one of the important services that you need in your app to manage user and their data. Supabase provides an authentication service that is very similar to firebase.

Supabase supports email & password, passwordless login called magic link, phone auth, and supports all the major Social Logins (OAuth) providers.

It provides you with a dashboard where you can see users and has a separate section for Email Template where you can customize the email sent to the users. Supabase provides Row Level Security and stores the data in a table, that you can extend with another table using a foreign key.

 let { user, error } = await supabse.auth.signUp({
    email: 'geekaid10@gmail.com'
    password: '********'
  })

I like how Supbase Auth returns the error as an object, unlike firebase where you need to wrap the signUp in a try-catch block.

3. Storage

The storage bucket that Supabase provides is very similar to AWS S3 and Firebase Storage. All these are similar but use different naming conventions.

To use Supabase storage you have to create a bucket first, you can choose to keep the bucket public or private according to your use case. In the bucket, you can upload files and create folders for organizing files.

To upload files you can either use the Supbase storage dashboard or from your app depending on your use case. The dashboard provides you with an interface that helps you to navigate and use it, this makes interacting and organizing the storage easy.

4. Documentation

Good documentation is very important for any platform and Supabase is no exception. Documentation helps developers to understand how to use the platform and helps developers troubleshoot

The Supabase documentation includes a getting started guide that provides an overview of the platform and step-by-step instructions on how to set up a Supabase project and start building and deploying applications. It also includes guides and references on topics such as the Supabase Database, Supabase Authentication, and more.

Supabase also provides resources other than documentation that helps developers get started with the platform, which includes a developer community forum, slack channel, and GitHub repository to help developers.

5. Edge Functions

Supabase has recently launched Edge Functions which allows you to write custom server-side logic in Node.js that can be triggered by events. The event can be anything like a CRUD operation in the database or a resource request.

The Edge Functions can be useful for integrating the platform with third-party APIs or performing tasks that would be very difficult to handle on the client side.

To use Edge Functions you simply need to create a Node.js project and using the Supabase CLI you can deploy your Edge Functions to the platform, where they will trigger for the events you set.

Conclusion

Subbase is not a one-to-one mapping of firebase services, it provides you with the services that your developers require to build an application. It still missing services like crashlytics, monitoring, and notification. Supabase has the potential to become a Firebase alternative one day.

Supabase database is a very good service if you need a SQL database in your application that comes with a good SDK. Supabase Authentication covers all the major authentication that anyone can need in their database.

The supabase also gives you the option to self-host the platform but people use BAAS as they do not want to handle the hosting of their backend.


I hope this article will help you to learn about Supbase and the services it provides.

If I got something wrong, Inform me on my social media accounts and feel free to contact me and help me to correct it, I would love to improve and rectify my mistake.

❤️❤️ Thanks for reading this article ❤️❤️

Did you find this article valuable?

Support Geek Aid by becoming a sponsor. Any amount is appreciated!