top of page
Search

Firebase vs. Supabase: Which is better?

Writer's picture: sundeepdayalansundeepdayalan


Backend-as-a-Service (BaaS) is a service model in which developers outsource all the behind-the-scenes aspects of web or mobile development so they can focus on writing and maintaining the frontend on a plug-and-play basis and avoid the stress of writing server-side code.

BaaS platforms provide software for server-side activities, such as authentication, database management, real-time updating, storage, hosting, and push notifications (for mobile apps). Over the last decade, we’ve seen the rise of companies offering these services, including Firebase, Supabase, Parse, Back4app, and AWS Amplify, to name a few.

Although these backend services essentially offer the same solution, they use different backend technologies. For many developers, this is a deciding factor when picking the best service for a given project.

For instance, Back4App offers both REST and GraphQL APIs out of the box, while Firebase uses NoSQL syntax and does not offer GraphQL out of the box.

In this tutorial, we’ll focus on Firebase and the open-source alternative, Supabase. We’ll start by exploring each platform individually, then we’ll compare Firebase vs. Supabase and offer some tips on how to choose the best tool for your project.

We’ll cover the following in detail:

  • What is Firebase?

  • What is Supabase?

  • Firebase vs. Supabase: Which is right for your project?



What is Firebase?

Firebase was initially founded in 2011 by James Tamplin and Andrew Lee. Google acquired the platform in 2014, and it’s now the company’s flagship offering for app development.

Firebase’s first product was the Firebase Realtime Database, an API that synchronizes application data across iOS, Android, and the web while storing it on Firebase’s cloud. Firebase has evolved into a full-blown BaaS service with products for both development and post-development phases.

Firebase offers products in three phases:

  1. Build

  2. Release and monitor

  3. Engage



Each phase represents a different stage of development. Firebase has created specific products for each of these phases.

Build

The build phase covers products that provide backend infrastructure for active development. These include core services used while building an application, such as authentication, storage, real-time database, Firestore, hosting, cloud functions, cloud messaging, remote config, and Firebase ML.

Let’s explore these features in more detail.

  • Authentication: Firebase provides an authentication service that allows users to register and create accounts on your application, including third-party sign-in services

  • Storage: Firebase offers storage as part of the firebase platform for user-generated media (images, videos, audio, etc.)

  • Hosting: Firebase allows hosting, making it possible to build and host your application within the same cloud service

  • Cloud functions: Cloud functions enable you to run your server-side code directly on Google Cloud, all in a controlled and secured environment

  • Firestore: Firestore is a NoSQL database that allows you to structure your database however you like and query it at lightning speed

  • Cloud messaging: This enables you to send push notifications to your users easily on a plug-and-play basis

  • Remote config: You can use feature flags to determine which features are turned on or off and, ultimately, what makes it to production

  • Realtime database: This is also a NoSQL database that enables you to sync data in real time and make seamless changes within your project

  • Firebase ML: You have access to machine learning APIs that can help you train and deploy your custom models

Release and monitor

Firebase tools in the Release and Monitor category are used to monitor the application after it has been developed and released. These tools include the following.

  • Firebase Crashlytics: This monitors crashes, reports them in realtime, and provides insight to help you pinpoint the cause and address issues

  • Google Analytics: This utility Provides detailed analytics making it easy to study user behavior and act on them

  • Firebase Performance Monitoring: This data helps you understand performance issues from the user’s perspective, including network behavior and latencies

  • Remote config: You can customize and make changes to your app on the fly. This feature is most often used in mobile apps

  • Test lab: This feature enables you to create simulations on both real and virtual devices to test your app before release

  • App distribution: You can easily distribute exclusive versions of your app to trusted testers

Engage

The products in this category are mostly used for mobile apps. They help you engage your users, optimize the user experience, and keep your users happy.

On the paid plan, Firebase provides cool extensions to help you build your app, add functionality, and deploy faster. There are too many to list here, but the most important features include the following.

  • Resize images: This extension lets you set a specified size that can be used to resize images uploaded to the Firebase storage. It stores both the original and resized images in the same storage bucket

  • Export collections to BigQuery: You can export specified Firestore collections to store in BigQuery, a cloud warehouse that allows you to query your database really fast. The process of exporting is incremental, so your Firestore and BigQuery are always in sync

  • Trigger email: You can trigger an email to be sent to a given mail based on the contents of a document written to a specified Firestore collection

  • Translate text: You can translate strings in your Firestore into multiple languages because the source language of the string is automatically detected through the Cloud Translation API

  • Delete user data: This extension automatically deletes a user’s data once the user is removed from your authenticated users. You can configure this extension to delete user data from any or all of the following: Cloud Firestore, real-time database, or cloud storage. Triggering the extension to delete data is keyed to the user’s UUID, which is unique to every authenticated user

What is Supabase?

Supabase describes itself as an open-source alternative to Firebase. It’s designed to help developers spin up their backend within minutes. Supabase’s mantra is “Build in a weekend, scale to millions.”


At the time of writing, Supabase products available for use include a Postgres database and authentication service, while storage and serverless functions (for backend logic) are still in the works. Supabase and all its tools are mainly open-source.


The Postgres database comes with database-related tools, including real-time listening to database changes and an interface for managing them. Plus, Supabase provides instant APIs and syntax that is somewhat similar to Firebase’s. This helps you handle CRUD operations in a straightforward pattern so you can focus on building rather than rewriting repetitive CRUD code.


The Postgres database is in the form of a table that allows you to store structured and related data like you would on any spreadsheet. Interestingly, when setting up a project, you can import an existing spreadsheet as your Postgres database.


Firebase vs. Supabase: Which is right for your project?


Now that we’ve explained how Firebase and Supabase work individually, let’s dissect and compare both technologies and examine when you should use Supabase over Firebase.


Importing preexisting data

With Supabase you can easily import a CSV or copy and paste a spreadsheet to kickstart your project. This is great if you’re migrating data from another platform to Supabase.



Firebase doesn’t offer inbuilt services that enable you to directly upload bulk data. The best you can do is use a third-party node script or something similar, which looks hackish. Plus, you will have to convert your CSV (or whatever format) to JSON before doing anything at all.


Pricing


Supabase is an open-source product, meaning it’s currently free. The Supabase team plans to charge for hosting when it is released. There are also contribution plans for individuals and enterprises to help sponsor the product.

Firebase, on the other hand, is not free. The free Spark plan is generous, making it a good fit for side projects that don’t generate any serious traffic. Enterprise applications would need to get on the Blaze plan (pay-as-you-go) to get access to the complete offering, including Firebase extensions and more space for database and storage.


Relational database vs. NoSQL database


Supabase is a relational database whereas Firebase is a NoSQL database. The most appropriate database for your project depends on what kind of app you’re building.

Relational databases are useful when your data are related, rigid, and need to be consistent every time. On the other hand, you might want to use NoSQL if you have flexible data with different data types and you need to move fast.

Both database types have their pros and cons. For instance, NoSQL databases could be repetitive, but querying the database is fast. That’s why it’s used for search engines and social media feeds. Consistency and performance are two big factors.


Data migration


When dealing with enterprise applications, data migration is often a priority, especially as the company scales.

Data migration on a NoSQL database without schema or an ORM such as Firebase could prove difficult compared to using a relational database, which is available with Supabase. It’s even harder when you’re already in production.

You can download all your data and schema as an .sql file in Supabase from the backup section on the dashboard. Alternatively, you can dump the latest data from the command line using pg_dump.

Choosing the right BaaS is heavily dependent on your project’s functional requirements and growth potential. If you’re building a big project, you should do your research to understand the constraints associated with each BaaS platform. This will help you avoid technical debt in the future.

LogRocket: Full visibility into your web apps



LogRocket is a frontend application monitoring solution that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.

In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps.

179 views0 comments

Recent Posts

See All

Comments


b1b60f666d5345775184d3a0d1ec7225.png

Contact us via

Subscribe to Our Newsletter

Thanks for submitting!

Follow Us On:

  • Twitter
  • Instagram

© 2021 by Crado

bottom of page