Stackmob vs Firebase – Backend as a Service comparison

Matthew Nuzum —  — 1 Comment

Last night Des Moines Web Geeks had a code dojo focusing on Firebase, a tool I’d seen demoed by a few locals, including Brad Dwyer‎ from Hatchlings. In under 2 hours three teams each built a secret santa app using only client-side HTML5, CSS and Javascript. It was awesome.

Firebase makes this possible by providing an abstracted server side component accessible using a pure client-side javascript API. This is called a Backend as a Service (BaaS) or in some cases a Mobile Backend as a Service (mBaaS) platform.

Another BaaS I’ve used, and one that has been in the headlines this week, is Stackmob, which was just acquired by PayPal. I’ve used Stackmob and am quite fond of it. Now, having some exposure to both, I realize that Stackmob and Firebase are very different products offering unique types of services, even though both are considered BaaS products. I thought I’d write up a little comparison of the two.

If you are a front-end javascript developer who could benefit from BaaS types of services I strongly suggest spending an afternoon to learn both of these tools. An hour each is enough to get signed up for a free account and work through their tutorials. Then you can dig a little deeper to see how they differ.

Introducing Firebase

I’ll start with Firebase, since I’ve used it more recently. The tutorial you visit after signing up walks you through the creation of a simple chat app. If you open two browser windows you can type a message into one and your text appears in both windows simultaneously. It’s slick, there must be some web-socket action going on. The beauty is that you don’t need to know how it works, it’s seamless to you the developer, abstracted behind a remarkably simple API.

As you dig in a little deeper you’ll see another tutorial that demonstrates creating a shared white-board application where people can draw on a canvas and see each others’ doodles in real time.

You might be starting to see a trend as I describe the sample apps: Firebase is highly targeted at real-time collaborative apps. I’ve built apps using Node.js and socket.io and I have to say that I’ve never felt as productive when creating this kind of app as I did using Firebase.

I originally expected a Database as a service, but as my team dug into the API a little, we realized this was not accurate. For example, we wanted to query all of the records for our secret santa participants that hadn’t been paired up with another person. Well, guess what, there is no “where” syntax for querying. You only have the ability to grab all, or grab the first n records or the last n records.

If you think you’re using a database, you’ll feel that Firebase is missing a critical feature. However, if you don’t think of it as a Database, but instead as a stream of activities, you’re expectations will be met or even exceeded.

Hello Stackmob

This sets the stage to compare Stackmob, which is actually more like a traditional database. The Javascript API is integrated with Backbone.js, a client-side MVC framework (imagine Rails but in Javascript). It does not offer the real-time data streaming support that Firebase offers, but it does let you query, create relationships and perform CRUD operations in way familiar to traditional database app developers.

Stackmob also has numerous built in capabilities, such as authentication and access control, including Facebook authentication, file storage, including S3 support, and geospatial queries. It also offers something extremely unique: you can write a custom Java server side component, upload it to Stackmob’s servers and access it using Stackmob’s API.

Mobile development and documentation

Both Stackmob and Firebase offer rich APIs to native mobile app developers with client libraries for iOS and Android. Firebase offers an excellent quickstart applications for four platforms, Javascript client-side, Javascript server-side (node.js), Objective C (iOS, Mac OS) and Java/Android.

Stackmob, in my opinion, offers much more extensive and comprehensive documentations, though in part because they also have a more complicated API. They have an excellent Udemy course on using Backbone.js and Stackmob together, they offer several quickstart applications and they even offer a series of ebooks focused on learning how to develop using their platform. For example, there’s a book on how to build an Air BnB clone, how to build a Snap-Chat like application, integrating with Facebook authentication and working with Phonegap. I love that they focus on building real-world applications and teach the entire stack instead of just explaining their API.

So which do I recommend? Both!

I have an idea for a real-time network game that would be so easy using Firebase. I have another application that mines data and would mesh perfectly with Stackmob’s services.

The beauty is that both have very generous free tiers for getting started and extremely helpful documentation to help you learn the basics quickly. How can I pick one over the other when they’re each exceptional in their own ways? I’ll keep both in my tool-belt.

If it helped, please share!Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

Matthew Nuzum

Posts Twitter Facebook

Web guy, big thinker, loves to talk and write. Front end web, mobile and UX developer for John Deere ISG. My projects: @dsmwebgeeks @tekrs @squaretap ✝
  • Guille

    Hey, thanks, great article