Backend as a Service – Part 1

Share this article

BaaS – Introduction

Backend as a Service, or depending on your tastes, Mobile Backend as a Service or even Server Stack as a Service is a relatively new cloud offering that is starting to gain momentum in many areas, not just the mobile world. BaaS, as we shall call it for the sake of brevity, has carved its own little niche nestled neatly between Platform as a Service (PaaS) and Software as a Service (SaaS).  Unsurprisingly, it does exactly what it says on the tin – that is – it provides a near complete server side stack including persistence, user management, data retrieval and querying, file storage and a few other things at the flick of a switch. While the original intention of these BaaS offerings was to avoid the friction and pain of setting up and maintaining a server backend for mobile developers, their use has become much more widespread.  After all, if all you need is some data storage and/or some user management why not?

Features of BaaS Offerings

This area of the cloud is still in its infancy and evolving on a daily basis.  The competition is quite strong with various companies looking to find a unique way to establish their product, however there are a number of baseline features that you should expect from these providers.

Basic Data Storage and Retrieval

Obviously the most important aspect of any of these services is a way to store and retrieve your data.  This is especially useful in mobile situations where you may not be bound to a single device or in a social or collaborative application that requires data be shared. Existing services offer a somewhat schema-less storage model and adding new object properties (or in a relational DB sense – columns) is a matter of adding them to your client code and pushing the new data.  Current services do offer a certain level of control around schema but this is fairly simplistic and not particularly useful for constraining data sent to the services.  While this flexibility can be a boon to developer productivity initially its worth remembering that as your applications complexity grows you will need to keep tight reign on your schema. Data types, as you’d expect, have a very mobile flavour.  Your typical types such as Strings, Dates, Booleans, Numbers etc. are obviously all available but the other key types that you can expect to see is GeoPoints – the ability to store location and Binary – for storing media.

APIs and SDKs

Exposing a single ReSTful HTTP API to your server stack can be somewhat limiting and often there are better ways to transmit data.  Due to this, and to alleviate some of the drudgery involved in communicating between your client and server, BaaS services typically give you a number of SDKs, each specific to a particular client platform.  These SDKs usually come in three flavors – iOS, Android and JavaScript (useful in, but not limited to, Shell Apps e.g. PhoneGap/Cordova based apps) and offers a cleaner abstraction to work with your service – user authentication, abstract model and collection classes, query builders etc. Alongside these SDKs, there is usually a basic ReST API that allows other platforms or any bespoke solutions people may dream up to work with these BaaS offerings.  It should be noted, however, that the ReST API is generally not as feature complete as the SDKs While some of the todays services keep true to their mobile roots and officially only offer mobile SDKs, services like StackMob have embraced the extended use cases and made their own official Ruby, Scala and Java SDKs.

Data Querying

Simple fetches of single objects and entire collections are one thing but often it is necessary to perform slightly more complex queries against your data. These services typically offer a way to perform these queries against your collections.  You’ll also find most services offer some sort of paging functionality to reduce the risk of unbounded queries being run against your data. Additional queries that come into their own in the mobile space are also available – namely geospatial queries.  For example all services typically offer queries such as “find me data points that are near a certain point” or “find me data points that are within a certain radius of a certain point” – so your “Best Bars in the World” app could easily show the bars/pubs/taverns that are closest to the users current location.

Binary Storage

Mobile devices are equipped with all manner of data capture instruments – from cameras for pictures and video to microphones for audio.  Its simply no longer all just typing words into a tiny keyboard and as such the BaaS services today generally offer varying levels of binary storage.  For example, Parse offers fully integrated file uploading directly from their SDKs while StackMob simply offer a channel to add your own Amazon S3 configuration and access this data via their ReST API.  Depending on your solution requirements this may or may not be an issue.

Data Security

If you are storing users data its vital that all and sundry aren’t allowed to just access it.  Parse
, Kinvey and StackMob all offer various methods to lock data down in ways you’d typically expect such as granting read/write access to data depending on logged in status, to a particular owner/user, to a particular role.  While each service offers similar features, there may be certain quirks or nuances that will want to validate against your requirements before settling on a specific provider.

Authentication

What good is a server stack if you have no way to authenticate users?  Not much I’d bet.  Thankfully BaaS offerings typically give you the ability to manage users and perform the various things a user would want to do – login, logout, reset password etc. Most services offer integration into the Twitter and Facebook authentication modules

Push Notifications

Finally, in the mobile world one of the key ways to notify users of changes to data or other external events is generally facilitated through Push Notifications.  Available on almost every mobile platform, push notifications allow you to send data to users devices even when the app is running in the background.  Without the use of a BaaS service you either had to write specific integration code to each OSs specific notification system or make use of another third party cloud service such as Urban Airship.  With BaaS its entirely possible to roll all this into a single managed service – in fact Kinvey, one of the three main BaaS providers, actually integrates with Urban Airship to support push notifications.

Considerations for BaaS Offerings

Obviously as with all things cloudy there are some things you need to consider before signing your life away.

Lock In

A common concern for cloud technologies is that of lock-in.  You don’t want to commit to a service only to have the carpet pulled from under you in terms of pricing, support, data sovereignty etc.  You want to make sure you can get your data out as fast as possible if you need to.  You also want to make sure that platform specific code doesn’t propagate too far into your codebase or at least understand the risk involved if you do decide to heavily integrate some platforms specific functionality.  For example – Parse offers an set of (entirely optional) UI widgets with their SDKs that allow you to quickly create login screens and Parse-data bound lists – if you decided you wanted to move to StackMob or Kinvey you would need to consider the effort required to essentially re-write those elements.

Data sovereignty

Where is your data being stored?  If user data is important to you, and of course it is, you’ll want to understand the implications of storing data in certain geographic locations.  For example, European user data stored in the United States is subject to certain US laws that it otherwise wouldn’t be if it was stored in Europe. Not knowing where your data is stored or having the ability to relocate that data could land you in a sticky situation if a user takes exception to your current setup. This is an area that most providers seem to be a bit vague about.

Pricing

Current BaaS services have varying pricing models.  As with most cloud offerings they generally offer a banded cost model and all have a fairly generous free tier.  Past the free tier different services offer different levels of granularity.  Understanding typical usage of your app upfront is vital.  In certain scenarios the monthly cost between any two services can be as drastic as the difference between $30 and $200 per month.

Closing Points

The BaaS world is still finding its feet and rather than being constrained to simply mobile devices they have been utilised in many other solutions and as such many are currently being offered as add-ons on popular PaaS services such as Heroku and AppHarborStackMob even goes as far as offering a PaaS model specifically for HTML5 apps utilising its server features.  Its truly an exciting area to be involved in. Hopefully this article has given you a better understanding of the Mobile Backend as a Service ecosystem.  In my next article I want to cast a critical eye over the current offerings in this space (Parse, StackMob and Kinvey) and show you where they rise or fall in terms of features and concerns.  

Frequently Asked Questions about Backend as a Service (BaaS)

What are the key benefits of using Backend as a Service (BaaS)?

BaaS offers several benefits to developers and businesses. Firstly, it significantly reduces the time and effort required to develop an app as it eliminates the need to write server-side code. This allows developers to focus more on the user interface and user experience. Secondly, BaaS provides scalability. As your user base grows, BaaS platforms can easily scale up to meet the increased demand. Thirdly, BaaS platforms often come with built-in features for common tasks such as user authentication, push notifications, and social media integration, which further speeds up development time.

How does BaaS differ from traditional server-side development?

Traditional server-side development involves writing code to manage server-side operations such as database management, user authentication, and server configuration. This can be time-consuming and requires a certain level of expertise. On the other hand, BaaS provides these services out of the box, allowing developers to focus on client-side development. This not only speeds up the development process but also reduces the need for specialized server-side developers.

Is BaaS secure?

Yes, BaaS platforms typically come with built-in security features. These may include user authentication, data encryption, and access control. However, the level of security can vary between different BaaS providers, so it’s important to choose a provider that meets your specific security needs.

Can I use BaaS for any type of application?

BaaS is particularly beneficial for mobile and web applications that require a server-side component but don’t need a fully customized backend. This includes social media apps, e-commerce apps, and content management systems. However, for applications that require complex server-side operations or custom backend functionality, a traditional server-side development approach may be more suitable.

What are some popular BaaS platforms?

There are several popular BaaS platforms available today. These include Firebase, Parse, Backendless, and Kinvey. Each platform has its own set of features and benefits, so it’s important to choose the one that best fits your specific needs.

How much does BaaS cost?

The cost of BaaS can vary greatly depending on the provider and the specific features you need. Some providers offer a free tier with limited features, while others charge a monthly or annual fee based on usage. It’s important to carefully review the pricing structure of each provider to ensure it fits within your budget.

Can I switch BaaS providers if I’m not satisfied?

Yes, it’s possible to switch BaaS providers, but it can be a complex process. This is because each BaaS platform has its own unique architecture and API, which may require significant changes to your application’s code. Therefore, it’s important to choose the right BaaS provider from the start.

Do I need to know server-side programming to use BaaS?

No, one of the main benefits of BaaS is that it eliminates the need for server-side programming. However, having a basic understanding of how servers work can be beneficial when using a BaaS platform.

Can BaaS handle high traffic applications?

Yes, BaaS platforms are designed to be scalable and can handle high traffic applications. However, it’s important to choose a BaaS provider that offers the level of scalability you need.

Is BaaS suitable for small businesses or startups?

Yes, BaaS can be a great choice for small businesses or startups. It allows for rapid application development without the need for a large development team or extensive server-side expertise. Plus, many BaaS providers offer flexible pricing options that can fit within a small business or startup budget.

James HughesJames Hughes
View Author

James works for Kainos Software Ltd. as a Technical Architect. He is Kainos' Mobile Capability Lead (and previously Microsoft Capability Technology Lead) and responsible for developer engagement throughout the company. In his spare time James likes to talk about himself in the third person, attempt to blog about technical things on http://yobriefca.se and troll Twitter as @kouphax

backend as a servicekinveymobile backend as a servicemobile cloud backend as a serviceparseStackMob
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week