Backend-as-a-Service (BaaS) allows developers to focus on the frontend of their applications and leverage backend services without building or maintaining them. BaaS and serverless computing share some similarities, and many providers offer both, but the two models have several differences.
What is BaaS?
Backend-as-a-Service (BaaS) is a cloud service model in which developers outsource all the behind-the-scenes aspects of a web or mobile application so that they only have to write and maintain the frontend. BaaS vendors provide pre-written software for activities that take place on servers, such as user authentication, database management, remote updating, and push notifications (for mobile apps), as well as cloud storage and hosting.
Think of developing an application without using a BaaS provider as directing a movie. A film director is responsible for overseeing or managing camera crews, lighting, set construction, wardrobe, actor casting, and the production schedule, in addition to actually filming and directing the scenes that will appear in the movie. Now imagine if there was a service that took care of all the behind-the-scenes activities so that all the director had to do was direct and shoot the scene. That’s the idea of BaaS: The vendor takes care of the ‘lights’ and the ‘camera’ (or, the server-side* functionalities) so that the director (the developer) can just focus on the ‘action’ – what the end user sees and experiences.
BaaS enables developers to focus on writing the frontend application code. Via APIs (which are a way for a program to make a request of another program) and SDKs (which are kits for building software) offered by the BaaS vendor, they are able to integrate all the backend functionality they need, without building the backend themselves. They also don’t have to manage servers, virtual machines, or containers to keep the application running. As a result, they can build and launch mobile applications and web applications (including single-page applications) more quickly.
*Server-side refers to everything that is hosted on or takes place on a server instead of on a client in the Internet client-server model.
What is Mobile-Backend-as-a-Service (MBaaS)?
Mobile-Backend-as-a-Service (MBaaS) is BaaS intended specifically for building apps for mobile. While some sources consider BaaS and MBaaS to be basically interchangeable terms, BaaS services do not necessarily have to be used for building mobile applications.
What is included in BaaS?
BaaS providers offer a number of server-side capabilities. For instance:
Cloud storage (for user-generated content)
Other platform- or vendor-specific functionalities; for instance, Firebase offers Google search indexing
BaaS and MBaaS providers include Google Firebase and Microsoft Azure.
What are the differences between BaaS and serverless computing?
There is some overlap between BaaS and serverless computing, because in both the developer only has to write their application code and doesn’t think about the backend. In addition, many BaaS providers also offer serverless computing services. However, there are significant operational differences between applications built using BaaS and a true serverless architecture.
How the application is constructed
The backends of serverless applications are broken up into functions, each of which responds to events and performs one action only (see What is FaaS?). BaaS server-side functionalities, meanwhile, are constructed however the provider wants, and developers don’t have to concern themselves with coding anything other than the frontend of the application.
When code runs
Serverless architectures are event-driven, meaning they run in response to events. Each function only runs when it is triggered by a certain event, and it does not run otherwise. Applications built with BaaS are usually not event-driven, meaning that they require more server resources.
Where code runs
Serverless functions can be run from anywhere on any machine, as long as they are still in communication with the rest of the application, which makes it possible to incorporate edge computing into the application’s architecture by running code at the network’s edge. BaaS is not necessarily set up to run code from anywhere, at any time (although it can be, depending on the provider).
How the application scales
Scalability is one of the biggest differentiators separating serverless architectures from other kinds of architecture. In serverless computing, the application automatically scales up as usage increases. The cloud vendor’s infrastructure starts up ephemeral instances of each function as necessary. BaaS applications are not set up to scale in this way unless the BaaS provider also offers serverless computing and the developer builds this into their application.
What is the difference between BaaS and Platform-as-a-Service (PaaS)?
PaaS provides a platform via the cloud for developers to build their applications. Like serverless computing and BaaS, Platform-as-a-Service (PaaS) eliminates the need for the developer to build and manage the application backend. However, PaaS does not include pre-built server-side application logic, such as push notifications and user authentication. PaaS offers developers more flexibility, while BaaS offers more functionality.