Open source alternative for Parse

Posted by | May 08, 2013 | 4 Comments

At iCapps, we use Parse to build the backend for a couple of our apps. However, the biggest risk of using a BaaS (Backend as a Service) is Vendor Lockin. The fact that you tie the apps that you build directly into one of the big BaaS providers. Which means that they have power over you, especially if you don’t abstract the way your app is tied to the backend.

The BaaS evolution is an interesting one, have a look at the map Kinvey has created:

You can see that there is a complex web of relationships between the major BaaS providers.

Since the news that Parse has been bought by Facebook, I’ve been investigating an open source alternative for Parse.

I looked at Helios and Deployd, both of which can be deployd to Heroku.

For this blogpost I’ve chosen to show you how to get started with Deployd, and how you can deploy it to Heroku.

For this blogpost you need a Heroku account, and a credit card (which should not be charged.)

Deployd is an open source api-building framework built on top of Node.js and Mongodb and supports

First lets have a look at what you need to install and deploy Deployd. Go over to node.js and install it through the installer package.

This will give you the node and npm utilities that you can use on the command line.

In your Developer folder, create a folder to put the app in.

Also create a temporary deployd project to make sure it is working locally.

First install deployd, you can do that by downloading the installer on
check that it is installed correctly with

should output something like 0.6.10

Next we can create the application locally:

and check that it is working correctly

you are now in ~/Developer/icapps-deployd/icapps-deployd-local

Point your browser to http://localhost:2403/dashboard. It should show you the deployd dashboard. We could use the local server to build and test the app, and that is what you should do. But now we’ll prepare an application to deploy to Heroku instead. Setting up a deployd app for Heroku takes a bit of a different approach.

In your terminal press ctrl-c twice to quit the dpd app. Let’s create a second application which we call icapps-deployd-demo.

You are now in ~/Developer/icapps-deployd/icapps-deployd-demo, which you can verify using the pwd command (print working directory).

then run

This installs the deployd package and all dependencies locally for the demo project. (there will be a node_packages folder)

Also install mongodb on your machine:

If you don’t have brew, you can install it, or use macports.

Then we can start building the application itself.
create a file app.js in the root of the project. (~/Developer/icapps-deployd/icapps-deployd-demo)

open the file in your favorite editor and write the following code:

Next we need to copy over the resources from the local project we created earlier with dpd


shows you:

We don’t need app.dpd, so

Next we need to create an access key for the application.

Copy this key to your clipboard, because we will need it shortly.
now, lets startup the application.

and point your browser to

Provide the key you have in your clipboard and deployd should work.

Our local preparation for the app is almost finished. We will now define the dependencies for our application for heroku. This way heroku can install the dependencies via npm.

And use your favorite editor and write:

Next we’ll also define Procfile, so that Heroku knows how to start the application

And use your favorite editor and write:

If you don’t have a Heroku account, setup an account on and download and install the Heroku toolbelt via An heroku account is free for a single web dyno, which is more than sufficient for the demo.

Back in the command line, create the git repository that we will use to push the code to heroku.

Then we create an application on Heroku using

Heroku will choose a random name for your new app, you can choose your own (unique) name using ‘heroku create my-app-name’

Mine was called

We need to configure a database provider as well. We can do this in the heroku dashboard, by adding an add-on for the app, or we can use the toolbelt.

gives an overview of the available addons for our app.

We will need mongodb, so lets filter

There are two options for the moment: mongohq and mongolab. For the demo I’ve selected mongohq. So let’s setup the addon:

Mongohq:sandbox is free, but you can scale it up if necessary. It is possible that you need to register your creditcard with heroku before you can add the addon. It should not be charged for this demo, but read the fine-print in any case.

Next, we need to configure our deployd application to connect to it. Therefore we need to find the database location and credentials.

Point your browser to your application in the heroku dashboard and find the addon. Clicking it should take you to the dashboard, which shows you the database that was created for you.

Mine was “mongo -u <user> -p<password>”. Yours will be different!

So we need to define a user and password, that the app can use to connect to the database. In Admin (in the menu on the left) tab Users, add a new user and password. I used icapps-app and icapps-pwd, but have since changed the password 😉

Make sure to remember the username and password. The password is saved after one-way hashing it, so it is not recoverable. (you can reset it though).

Now let’s test if the db is up and running

Again, make sure you replace this with the address that is genereated for you.

And it is working. Type exit<enter> to quit the MongoDB shell.

Next we need to change the db settings for deployd, so open up app.js and make sure it reads like this:

Make sure to replace the port, host, name and credentials.username and credentials.password with what was created for you.

We can now commit that change

Next we push our app to heroku using

If you visit your application (mine was, you get an application error. Let’s check why

this shows that the directory resources is missing.

This is annoying, because git doesn’t know about directories. The resources directory is empty, so git ignores it. We can easily fix this.

Again try to push the app to heroku:

Try and visit the application now on (your url will be different.)

In the addressbar, add /dashboard, and we are up and running. (Use dpd showkey if you forgot your key)

Refer to the Deployd examples and documentation to build the rest of the website and REST api.

In a next blogpost, I will show you how to use DeploydKit to connect to this backend and build a small application, which also uses Socket.IO for realtime communication. We could also build a web-app using for example Angularjs, that connects to this backend.

The main advantage of not using one of the big BaaS providers is that you can always take your backend code and move it to your own server, or another IaaS provider. Another important advantage is that you can see and change the open source code (contributing back to the open source community) should the need arise.

The disadvantage is that the open source solutions cannot currently compete on features well with the big BaaS providers, and as a consequence, the up-front costs of choosing and maintaining the open source solution will be higher. Freedom comes with a price.


Leave a Reply

Your email address will not be published.