What is Parse.com, and what are the pros and cons of this service?
I recently had the opportunity to try out Parse.com's API for a couple of projects, including our new recruitment web app http://www.flagd.com. We needed an API backend as a service solution since we wanted the option to eventually create native Android/IOS versions of the app. Parse looked like the best solution because they have SDKs for just about every platform, they've got a pretty solid free tier, and they allow you a reasonable level of control over your code.
But like every service, there are both pros and cons to using Parse. Overall I was extremely impressed, especially with what you get on the free tier.
Here's a breakdown/summary of what I thought was good about it, and the pitfalls of using Parse for your production app. It should be noted that we were using https://angularjs.org/ for these projects, which proved to be a great companion for Parse, and vice versa.
- Impressive free tier with 30 reqs per second, 1 million push messages
- Powerful dashboard for managing data, viewing analytics, managing scheduled jobs
- Web server with ExpressJS, allowing you to host your app's static content.
- Cloud code, allowing you to add hooks and custom routes, for modifying objects before they enter the DB.
- MongoDB for storing your data
- Built in email verification and password reset
- Built in user object with security
- Built in ACL for objects
- Allows custom domains as well as SSL-enabled domains
- Handles file uploading with an elegant image module, allowing for resizing and cropping of images.
- Now owned by Facebook Inc., so likely to stick around for a few years
- Built on top of the AWS stack
- Built in Facebook and Twitter Oauth
- Backup your data anytime using export features
- Import data via CSV or JSON documents
- Fairly exhaustive documentation, along with a Stackoverflow-style Q&A site.
- CLI tool for rapid deployment of cloud code or static assets (deploys in seconds)
- Expensive once past the free tier (starts at $100/m)
- Expensive for DB data storage past the free tier ($200/20gb)
- Does not support NPM/node modules on their web server, meaning you can't add node modules for things like OAUTH (Google, LinkedIn, etc.). This means you do have to spend more time writing code you wouldn't normally have to write.
- Does not support SSL on their file system (i.e. uploaded files). Files are served from files.parsetfss.com, and there is no certificate present on this domain (at least at the time of writing this).
- No way to configure headers for static assets from what I can see, which meant I wasn't able to solve the cross origin problems associated with fonts. This may be possible using ExpressJS however.
- I've experienced occasional downtime, which usually doesn't last more than a few minutes.
- No easy way to separate staging/production environments apart from cloning the app, and using different credentials for each.
How I solved the critical problems I experienced
I had to write some custom code to handle OAuth. For uploaded files, I used Amazon S3 instead and ran all assets through Cloudfront distributions, solving the font issues.
Since I was using Yeoman with Angular, I tweaked my Grunt configuration slightly to basically create a copy of the app for production which had a unique Parse configuration for deploying (global.json). So I can build for staging and production in a single step, and then just deploy to Parse using their CLI tool.
Should you use Parse.com?
As with most of these discussions, it all depends on what you need and how much you're willing to pay when/if you end up running the app at scale. Parse.com is definitely an awesome way to build a prototype, and not have to worry about maintaining another codebase like a Rails backend just to store some data.
What are other similar options? - Google now owns Firebase, which is a similar service but has a less potent free tier (development tier). - Apple now offers its own API Backend on iCloud, called CloudKit. CloudKit is only for the Apple ecosystem.
What I would like to use in the future
I haven't ever sampled anything like this, but from a Google search, http://loopback.io is an open source API as a service/NodeJS platform with SDKs for Android, iOS and Angular. So you can install this on your own server at low cost, and also have the benefits of being able to tie up the app quickly on your various clients. Maybe I'll try this next time!
All things considered, for rapid development, prototyping, or even production, Parse.com is a pretty amazing solution. For our team at Lab19 Digital it provides a great way to get a production-ready app up and running without worrying about configuration and scale.