What is Supabase, and Why Should I Use It?

Before you continue, I am trying out implementing Imagen 3 into wordpress directly and after this post, most of the posts will include an image generated by it.

Good day to you, dear reader. I hope that everything is going well for you. Today, I wanted to tell you about one of the cool kids on the block: Supabase, a great (if not better) alternative to Firebase.

I remember when I first discovered Supabase while looking for alternatives to Firebase. I was amazed—most open source alternatives to commercial software tend to fall short, but Supabase is different. They even include a free cloud-hosted instance for testing (or even production use)!

What is a Database?

To explain what a database actually is, imagine an ocean—a vast storage filled with diverse creatures (data). In this metaphor, a fisherman uses hooks to catch various fish, examining each to understand the ecosystem. Similarly, a database stores data, and we use querying languages as our hooks to retrieve and inspect pieces of information.

Just as every ocean has its unique characteristics, different databases have unique architectures. They generally fall into two main categories:

  • Relational (SQL) Databases: These are structured around tables with rows and columns and use SQL for querying.
  • Non-relational (NoSQL) Databases: These include models like document, key-value, columnar, and graph databases, each optimized for different types of workloads and data structures.

Using relational or non-relational systems can differ based on your use case—but when it comes to prototyping, non-relational databases may provide a simpler setup.

A Brief History of SQL

SQL is a domain-specific language for managing data and is widely used in relational database systems such as MsSQL, MariaDB, and SQLite. Originally developed by IBM in the 1970s, it became the industry standard in the 1980s with the support of the International Organisation for Standardisation. While the history of SQL is fascinating, we won’t dive too deep into it here—especially since Firebase, a NoSQL provider, sets the stage for our discussion.

Alternatives to SQL

Why look for an alternative?

That’s a great question! And the answer may shock you: sometimes we don’t need such complex schemas to store data. Schemed systems are great, but non-schema-based systems bring their own benefits. This is why Carlo Strozzi in 1998 created one of the first systems that did not expose SQL (yes, NoSQL has roots going back to the 1960s—but back then they weren’t called NoSQL). Thus, NoSQL was born!

Okay, Metin, Where Are the Alternatives?

Oh, sorry—I forgot to list the real alternatives. Below is a table that explains them with some details:

AlternativeTypeDescriptionExamples
Flat-fileFile-Based StorageSimple file storage systems that use plain files (CSV, JSON, etc.), ideal for small datasets or configurations where complex queries aren’t needed.CSV, JSON, XML, SDB, TSDB
NoSQL DatabasesNon-RelationalFlexible systems that bypass rigid schemas, handling diverse and evolving data structures; includes document, key-value, columnar, and graph models.MongoDB, Cassandra, Neo4j, Redis
NewSQL DatabasesRelational & ScalableModern systems combining traditional SQL features (with ACID compliance) with horizontal scalability akin to NoSQL solutions.CockroachDB, TiDB
In-Memory StoresMemory-BasedOptimised for speed by retaining data in RAM, perfect for caching and real-time analytics, although persistence might be limited.Redis (also a key-value store), Memcached
Backend-as-a-Service (BaaS)Managed ServicesAll-in-one solutions that bundle a database with real-time updates, authentication, hosting, and more; abstracting backend complexities from the developerFirebase (NoSQL-based), Supabase (SQL/PostgreSQL-based)

Flat-file, Really?

Flat-file databases are the most straightforward form of data storage. They involve saving information in simple text files (like CSV or JSON) without the overhead of a database management system. While perfect for small applications or quick prototypes, they’re not built for the kind of scalability and querying power required in complex applications.

Oh, So NoSQL Exist Then

Yes, they do! NoSQL databases provide a different approach to data management by doing away with the rigid structure of SQL. They excel at handling unstructured data and are often preferred for applications where flexibility and scalability are key. From document stores to graph databases, the NoSQL ecosystem offers solutions for a wide range of challenges.

What Do I Mean by NoSQL?

NoSQL refers to a group of databases that use varied data models instead of the tabular relations found in SQL databases. They offer flexible schemas, allowing developers to store data in forms that best suit their application’s needs—whether it’s JSON documents, key-value pairs, or graphs. This flexibility comes at the cost of some traditional features like complex multi-table joins, but in many modern, distributed applications, that trade-off is worth the increased agility.

What is Firebase?

Firebase is a comprehensive platform provided by Google for building web and mobile applications. At its core, Firebase originally started as a realtime NoSQL database, designed to update data across clients in real time with minimal latency. Over time, it has expanded to include a variety of services beyond just databases.

A Brief History of Firebase

Firebase began its journey as a realtime database solution aimed at simplifying backend development for realtime applications. After being acquired by Google (Rest the original developer’s souls) in 2014, Firebase rapidly grew into a full-fledged platform offering an array of services—from authentication to cloud messaging—integrated into its ecosystem.

Services Offered by Firebase

Firebase provides a broad range of services that cater to modern app needs:

  • Realtime Database & Firestore: NoSQL databases that allow for realtime data synchronisation across clients.
  • Authentication: Tools and APIs for secure and user-friendly authentication.
  • Cloud Storage: Scalable file storage for user-generated content.
  • Cloud Functions: Serverless functions to handle backend logic without managing servers.
  • Analytics & Crash Reporting: Built-in tools for monitoring app performance and tracking user behaviour.

Why Look For a Replacement?

While Firebase offers an impressive suite of features, it also comes with a few trade-offs. Its proprietary nature can sometimes lock you into a specific ecosystem, and the usage-based pricing model may lead to unexpected costs as your application scales. Additionally, Firebase’s NoSQL structure might limit complex querying and relational data management in certain scenarios. These challenges open the door for alternatives like Supabase, which promise a more open and flexible solution.

I Read Too Much. What is This Thing That You Call Supabase?

Supabase is emerging as a formidable alternative to Firebase, aiming to blend the power of SQL with the convenience of realtime capabilities. Built on PostgreSQL, Supabase offers an open-source backend solution that empowers developers with a rich feature set and the freedom to self-host if desired.

Open Source

One of Supabase’s standout features is its commitment to open-source development. Being open source means that its code is transparent, modifiable, and supported by a vibrant community. This not only reduces the risk of vendor lock-in but also fosters innovation and rapid improvements driven by real-world use.

Features

Supabase packs a range of robust features, including:

  • Fully Managed PostgreSQL Database: Leverage the power of SQL with familiar relational data models.
  • Realtime Subscriptions: Built-in support for realtime data tracking using PostgreSQL’s built-in replication capabilities.
  • Instant RESTful APIs: Automatically generated APIs that make it simple to interact with your data.
  • Authentication & Authorisation: Seamless integration for managing user access and security.

Self-hosting Options

For developers concerned with control and privacy, Supabase offers self-hosting options. You can deploy your own instance on your infrastructure, ensuring data sovereignty and overcoming challenges posed by public cloud limitations. This flexibility is invaluable for enterprise applications or when regulatory requirements demand complete control over data.

Pricing

In terms of pricing, Supabase presents a transparent model. Unlike Firebase’s usage-based costs, Supabase typically bills based on data storage and network usage, making it easier to predict expenses as your application scales. Moreover, its free tier is generous, allowing you to experiment and even deploy small-scale production apps with minimal cost.

Conclusion

In wrapping up, both Firebase and Supabase offer exciting possibilities for modern app development. Firebase’s seamless integration and robust realtime capabilities have made it a favourite among many developers. However, for those who value openness, control, and the power of SQL, Supabase stands out as a promising alternative. Whether you prefer the flexibility of NoSQL or the structured approach of a relational database, there’s something out there to suit every use case.

Also, I just finished Netflix’s Castlevania Nocturne, and it was great. Even for a non-anime watcher like me, it prompted me to search for better content. Currently considering rewatching Netflix’s Castlevania again (not Nocturne, mate. Not Nocturne.).

If you have suggestions for me, please do share them on Mastodon.


Subscribe to my newsletter


ABOUT ME

Hey there! I’m Metin, also known as devsimsek—a young, self-taught developer from Turkey. I’ve been coding since 2009, which means I’ve had plenty of time to make mistakes (and learn from them…mostly).

I love tinkering with web development and DevOps, and I’ve dipped my toes in numerous programming languages—some of them even willingly! When I’m not debugging my latest projects, you can find me dreaming up new ideas or wondering why my code just won’t work (it’s clearly a conspiracy).

Join me on this wild ride of coding, creativity, and maybe a few bad jokes along the way!