Firebase vs. Amplify for Mobile Development
Introduction
In my consulting work helping companies design and deploy their mobile applications, most clients (especially startups) need to provision and deploy a mobile back-end service along with their application. My go-to platforms to accelerate time-to-market for mobile apps are?AWS Amplify?and?Google Firebase. This article is a high-level comparison of these two excellent mobile back-end as a service (MBaaS) platforms.?
Purpose of this Article
The purpose of this article is to provide a high-level, architectural understanding of?AWS Amplify?and?Google Firebase. I won't be making a deep dive into either platform--they're way too broad and deep to cover in a blog post. This is intended as a starter for your thinking about whether to use either of these platforms in your next mobile project.
By the end of the article I hope to provide a glimpse of what to expect when using either service, where each platform has some differentiation and a general idea of which might be more appropriate for your situation. Do keep in mind the analysis and advice int his article is from my own field experience, and others may have formed different opinions--that's perfectly OK.
Is one of these always the best?
I'll just state up front that I won't be declaring either Google Firebase or AWS Amplify as the absolute best choice for all mobile application deployments.?Both MBaaS platforms are built and maintained by outstanding companies, and both are very reliable. I've been happy using both of them.
That said, I believe each platform was designed and built from a different perspective and with different priorities at the top of the list, which I'll discuss below. These different approaches definitely can make one better than the other for a specific circumstance, and I have pushed some clients toward one or the other, and pushed some clients away from one or the other depending on their situation.
What is an MBaaS?
It's important to understand what an?MBaaS?is, so if this is a new term for you don't skip this section.
Mobile apps can have multiple tiers (similar to modern web applications), but in practice they?have more in common with the traditional client/server architecture. I'll use client/server interchangeably with front-end/back-end in this article.
Client (i.e. front-end)
For mobile applications, the?client?is the code that runs on the mobile device.
Server (i.e. back-end)
Some mobile apps are 100% client code--for example a to-do list that isn't shared with anyone else. But the majority of mobile apps leverage back-end code to support their features.
Before MBaaS
Before cloud services were common, all mobile back-end services were purpose built for an application on dedicated server hardware or shared VMs in an Infrastructure as a Service (IaaS) model, such as Amazon EC2 instances.?As you probably imagine, building and operating these services securely for a complex application is very expensive and requires many skill sets to be on-hand for development and operation.
MBaaS?
As public cloud services have matured, mobile backend services can now be purchased without dedicated resources. Modern MBaaS systems are server-less and are billed on a usage-based model, a/k/a Platform as a Service (PaaS).?
When back-end services supporting mobile apps are well integrated and packaged specifically to support mobile apps, we?refer to the offering as a mobile back-end as a service (MBaaS).?
Firebase and Amplify both fall into this category, providing pre-packaged offerings that support mobile applications. Both also support web-based applications (that have no mobile components), so they go beyond MBaaS in their execution.
Relationship to core AWS/GCP
It's probably obvious that?AWS Amplify?is built on top of?Amazon Web Services (AWS), while?Firebase?is built on top of?Google Cloud Platform (GCP).?
In both cases, the company recognized that providing more approachable, easier to use mobile app/web app services would attract developers that may be?intimidated by the complexity and learning curve presented when directly using a full cloud computing stack.
For both Firebase and Amplify, developers can get up and running without the support of skilled AWS/GCP professionals. How they provide their respective abstraction layers over their core cloud platforms is different, which I'll discuss more below.
Core?Modules
AWS Amplify and Google Firebase both support what I believe are the core MBaaS offerings that almost every MVP Mobile Application will need:
All of these features should be server-less and auto-scaling.
Of course, each service has differentiated and unique features. For example Firebase supports?attestation, which provides an enhanced layer of security for API access, whereas (at this writing) Amplify does not.?Conversely, Amplify has a robust?environment solution?(e.g. dev/stage/prod), where Firebase (at this writing) does not.?
Almost always, unique extra features?can?be implemented on the other platform. But the raison d'être for an MBaaS is to remove the need to implement platform features "by hand", instead freeing developers to focus on implementing application features rather than platform features.?
When evaluating MBaaS platforms, it's critical to understand what features you need, and select the platform that provides those features directly whenever possible.
Here's how Amplify and Firebase support these core requirements:
User Authentication
Overall?
Firebase Auth has fewer features available compared with Amplify, but also has a lower learning curve and many of its mobile-specific tasks are better integrated than Amplify.
Amplify Auth potentially has more features since it's a thin abstraction over Cognito, but to access those features requires core AWS platform skills most developers will need to learn first.
Social Media & Federated Authentication
Federated authentication?refers to trusting an external authentication source to confirm a user's identity. For example, your app may use your company's Active Directory or other SAML provider for authentication.
Social Media authentication?is really a subset of Federated Auth, where the trusted external source is a social media property, such as Twitter or Facebook.
Overall, both Firebase and Amplify have excellent features for social media sign-in, and both support Federated login schemes. Between the two it's hard to recommend one over the other, except that I'd recommend Firebase if social media sign-in is a critical requirement. I find Firebase's implementation more complete (see above Sign in with Apple discussion), and generally it's easier to configure social sign in options.?
领英推荐
NoSQL Database
The data offering is the area where I think there's the most amount of difference between these two offerings.
Most developers and database pros at this point have a good understanding of the difference between a SQL database and a?NoSQL?database.
As NoSQL relates to mobile app development:
Both Amplify and Firebase have NoSQL database services and both provide all these requirements, but with different strengths:
Overall, both Amplify and Firebase have highly capable and scalable NoSQL offerings. Firebase is definitely the one that's easier to get started with compared to Amplify. However, Amplify has defined schema, relationships, GraphQL flexibility, a model generator and more knobs and switches to use to create more complex solutions. Where Firebase is a "code first" database, Amplify is a "data structure first" database.
BLOB Storage
BLOB stands for?Binary?Large?OBjects.?Typically in a mobile app context, this means images, firmware upgrade files, large pieces of text, PDF files, etc. While it would be possible to UUEncode this type of data and store it in a database, it's not efficient and would increase operational costs.
Overall the Firebase and Amplify BLOB storage features are very similar, and either will meet the needs of most mobile developers.
Server-side Functions
In recent years all top-tier cloud providers have implemented some form of back-end functions.?Briefly, a backend (or cloud) function is an API endpoint that is available to a front-end application to call.?
In practice a cloud function is not different than, say, a Node.js POST endpoint installed on a load-balanced mid-tier server.?The difference is more in?how?that endpoint is deployed.?With cloud functions, the provider (AWS, GCP, Azure) spins up the function (endpoint) on demand, billing for the number of calls, rather than for the physical hardware used to run the function.
Using functions will often be less expensive than paying for reserved backend server instances. But almost certainly it will be more flexible and reliable in small to medium scale deployments.
The combination of easy deployment and hands-off administration/scaling makes functions perfect for mobile app back-end server-side code.
Like BLOB Storage, the cloud function features provided by Firebase and Amplify are very similar, with neither providing a significant differentiation over the other. Both will meet the needs of most mobile projects.
Managed Hosting
Although the focus of this article is Mobile Applications (e.g. Android and iOS), when a back-end platform is implemented we usually need to add some type of web-based administrative application. This web-based application may be needed for any or all of the following use cases:
Both Amplify and Firebase have excellent support for web applications as well as mobile apps.?All features we would need to use to update the same data, BLOB resources or call into functions are available via JavaScript APIs on both platforms.
Both Firebase and Amplify also support publishing web applications to a managed hosting environment. For example AWS will publish a SPA Web App to S3 and configure a CloudFront CDN endpoint without requiring a developer to have the skills to make those configurations manually. Firebase provides equivalent functionality to support managed hosting of an admin web app.
Which is the better choice for you?
The above summary of features discusses what I consider the "core" features an MBaaS offering.?Both Amplify and Firebase offer unique features the other doesn't. If your project has a very specific requirement met by either platform--it would be difficult to recommend the other, as they're both excellent.
In the remainder of this section, I'm going to assume that your needs are the 90% of mobile app needs covered by the basic features discussed above.
What's your organizations larger technical landscape?
Very few applications are developed on an island.?A startup building its first product is an exception--but if your company is already deployed on AWS for other projects, and has teams trained and ready to help configure and support an AWS Amplify deployment--that may well be a deciding factor--and that's OK.?The same for Firebase--if your company has adopted GCP already and has trained resources to help, Firebase would be hard to beat in that scenario.
Desired Level of Abstraction
This is a subjective criteria--but how much abstraction from the back-end services do you want while developing your app??Conversely, do you want it to be as easy as possible to jump past the MBaaS abstraction layer and turn the knobs and dials in AWS or GCP yourself?
Team Size
The next dimension to consider when choosing between these products is team size. In a small team, complexity can become a significant bottleneck to progress. If avoiding complexity and keeping the team focused on the application is a priority, Firebase is the less complex offering of the two.
On the other hand, if the team is larger, it may have the bandwidth and willingness to dedicate resources to learn and use the more complex feature set offered by AWS Amplify.
Team Composition
For a team that won't have dedicated Back-End developers/system administrators, AWS Amplify will be more challenging.?Amplify is a thin layer over AWS Resources such as S3, AppSync, and Cognito (among others).?Mid-way through most projects, the team will likely need to begin learning how to directly manipulate AWS's JSON-based authorization rules, CloudFormation configuration files and start writing GraphQL queries.?If learning these underlying technologies will be too disruptive, Firebase may be the better option.
Conversely, if the team will have dedicated Back-End developers and administrators, they may prefer adopting AWS to provision more complex and sophisticated services themselves as part of the platform. Google Cloud also would allow a larger team to deploy GCP resources "underneath" Firebase, so this approach isn't specific to AWS--but Amplify arguably has more transparency in its abstraction layers.
Summary
I hope this gave you a good, high-level view of how Amplify and Firebase compare, and at least some idea of how to evaluate whether to adopt either one. As I said in the beginning, I don't think every project will arrive at the same answer. Both services are competing for the same customers, but they've come at it from a different starting point and have created services that have different strengths.
AWS Amplify
Google Firebase
This article was originally published at www.cuvenx.com.