Adam Hunter

Made with in NYC

Backend as a Service

Exploring BaaS with AWS Amplify, Google Firebase and Supabase

1.25.22


A Backend as a Service (or BaaS or mBaaS if you are being super specific for mobile development) is a cloud-based platform that provides developers with various sets of tools and services to create, manage and deploy applications without having to manage the underlying infrastructure. Basically, BaaS allow developers to build secure and scalable apps by aggregating and managing backend resources. Backend resources meaning database services, storage, analytics, serverless computing, etc. Cloud-based is just a cool way to say it is already deployed and on the internet.

Why is this necessary? Are BaaS platforms for lazy developers and for developers who don’t know backend development? If you are a real coder, shouldn’t you build your own backends? Truth be told, most professional backend developers are using these BaaS services and platforms. Despite what Elon Musk currently thinks, application development can be extremely laborious, especially when dealing with compliance requirements regarding authentication and data protection. Having a third party service for something like authentication means that dedicated teams of professionals are handling it and to be blunt, if you get hacked you will not be legally responsible.

I want to get into a high level overview of three BaaS platforms that have been on my radar for a little while now and that I think are really cool.

The first one is Google’s Firebase. Released in 2012 and acquired by Google two years later, Firebase is the OG of next generation BaaS platforms. It was one of the first platforms to offer a service that allows all connected clients to be synced to a NoSQL database in real time, aptly called the Firebase Realtime Database. Having all data stored as JSON, synced in real time and being available offline made Firebase virtually universally awesome for iOS, Android, and web development. The Firebase Realtime Database does have drawbacks. It does not scale well. With complex data requirements the entire app can slow down and would also get expensive to run. Firebase now has a second option to handle more complex data called the Firestore. The Firestore is also NoSQL but stores data in documents organized into collections making it more suitable for large scale applications. These databases that put Firebase on the map are ironically where I see a lot of criticism in the community. Since these are Firebase specific databases, it might not be easy to migrate off of them to a different service. Since it is Google, if you are using Firebase you will be able to easily integrate any GCP (Google Cloud Platform) services.

Next up is Supabase. Supabase call themselves an open source Firebase alternative. Supabase offers a lot of the same functionality as Firebase such as the realtime cloud-based database, authentication and serverless functions but deviates in some pretty significant ways. Aside from the obvious of being open source instead of being Google’s proprietary platform, Supabase is built on top of PostgreSQL. That means using relational databases instead of NoSQL. PostgreSQL is one of the most flexible and powerful databases around which means Supabase can handle much more complex data structures and queries out of the box. Supabase can also be self-hosted instead of being locked into the GCP ecosystem. Additionally they even have more robust security features than Firebase. The drawbacks of Supabase are mostly from how new the platform is. Supabase has only been around for a couple of years and is still actually in beta. I have read about breaking changes from API updates in the community, so developers need to stay on top of their projects. Supabase is definitely cutting edge.

The final BaaS platform I want to talk about is AWS Amplify. Released in late 2017, Amplify was Amazon’s response to Firebase. Amplify leverages the gigantic AWS ecosystem and makes creating and managing these resources extremely accessible. AWS Amplify comes out of the box flushed with features using some familiar resources. It uses Cognito for authentication, DynamoDB as the database and can easily integrate any AWS service such as S3 or AWS Lambda. Amplify also leverages AppSync which does a lot of the heavy lifting in securely connecting to these resources through a GraphQL schema. AppSync can automatically generate a client-side library in multiple languages (JavaScript, iOS, and Android) that makes it easy to interact with the API from your application. In addition to the Amplify CLI, Amplify also has a visual builder to create and manage cloud resources. You can use either the CLI or visual builder or bounce between the two. Amplify also has hosting capabilities including support for Next.js 12 and up. Truth be told, AWS Amplify is so robust that this paragraph just scratches the surface of its capabilities.

AWS Amplify is definitely the more powerful and more comprehensive BaaS platform on this short list but that also comes with being the most complex and the most expensive. For small and personal projects Firebase and Supabase are great options but they will have a hard time keeping up with AWS’s wide range of services and scalability options.

When exploring technologies like these, I usually like to see who actually uses them. Since Supabase is so new, it was pretty hard to find any information on who is using it in production. For Firebase we have Lyft, Snapchat, Duolingo, Spotify, NPR and Alibaba. For AWS Amplify we have Airbnb, Netflix, Twitch, Zillow, Capital One and The New York Times.

There are a ton of BaaS platforms to choose from, honorable mentions being Microsoft’s Azure and Hasura. They all provide database services, authentication services, and other features that make it easier to develop and deploy web and mobile applications. Additionally, most of them provide a range of other services, such as analytics, storage, and serverless computing. Choosing the right one will of course, ultimately come down to project requirements but also developer comfort zones. If you are already comfortable in AWS environments, using Amplify would make a lot of sense. If you are ethically opposed to Amazon as a company, Supabase might be worth exploring.

Adamadam hi

Adam