Parse.com provides a backend service to developers. If your mobile or desktop app requires a backend on the internet, then Parse is one of the options you can choose.
Today, I want to take a closer look to see what you get, how much it costs and if it potentially replace your own provisioned services and code that you use to interface with your own servers.
Plans and Pricing
Parse offers three different plans at the moment. The first is free and allows your app to make 1 million requests per month with a burst limit of 20 requests per second. They also provide 1 million pushes per month.
If your app is popular and you need more then to jump up to 15 million requests per month will cost you $199 which for an app of that size, it’s relatively cheap. You get 5 million pushes on this price plan and the burst limit is increased to 40/second.
If 15 million requests isn’t enough then you need to look at the enterprise plan. Prices are not provided because at that app size, they need to provide a custom solution which will adapt to your apps growth rate.
Creating Your First Parse App
As soon as you register for the free (or any plan), you need to create an App on Parse. You do this for each of your smartphone apps that will use Parse as the service. Parse also recommends that you create test Apps on Parse so that when you update your app in Xcode (or on another device), you have somewhere to test it before switching back to the production App.
When you have created your first App you are provided with all of the app keys. There are 6 in total although you wont need them all, but do make a note of them just in case.
Parse allows you to access your data through objects. When you create a new App in Parse, you can create a new class and then import data in to that class. Imports can be from CSV, XLS, TXT and JSON files, or you can manually create the table in each class by defining the columns and types of data stored.
Adding data and creating columns takes just a few lines of code. In the quickstart menu, you can see specific ways to test your selected app.
Towards the bottom of the page you can literally create a testObject and add data to the table and save it in just 3 lines of code.
A Look at Objects
Parse has a number of objects you can work with. One of them is PFObject which allows you to store data in Parse.
Example code could be as follows:
PFObject *gameScore = [PFObject objectWithClassName:@"GameScore"];
[gameScore setObject:[NSNumber numberWithInt:37] forKey:@"score"];
[gameScore setObject:@"Matthew" forKey:@"playerName"];
These 4 lines of code create an object called gameScore and then store two values within that object. The last line saves the data.
The parse documentation explains that classes are lazily created. Because GameScore probably doesn’t exist on this first run, the class is created. When new object is created, the score and playerName keys are created if they don’t exist or added to if they do exist. Other helpful information is automatically added such as time stamps.
As well as saving data in Parse, you can also retrieve data. You do this with a PFQuery if you have the objectID. Retrievals make use of blocks or callback methods that asynchronously run and inform your app when data is retreived.
Parse has created a way for devices that are off line to keep data safe. Typically, data on Parse is updated as soon as it changes on your app. In some cases, signal will be low or non-existant. Although your app might be limited in retrieving data (depending on if you keep local caches), the good news is that you have the option to saveEventually. The SDK stores data locally and when a connection becomes active, all queued up data is then saved to Parse. These are stored in the order that they they occurred.
Saving Large Amounts of Data
The documentation indicates that Parse is also able to handle large amounts of data. For file sizes under 128KB you can use NSData. For files larger you can use PFFile.
Moving Away from the Documentation
The purpose of the last few sections wasn’t to show you how to use Parse. It was to simply show you in a very small way what Parse can accomplish. The documentation is jam packed with different features such as showing ways how to subclass PFObject so you can work more easily with properties.
The idea is simple though. Parse takes care of managing and maintaining backend servers and provides all the server code and SDK functionality to let you get connected while you concentrate on working on your app.
Integrating is dead simple. You create an App in Parse, add a few lines of code to your AppDelegate which contains the correct keys, add the framework and import the necessary frameworks and then begin using the objects to store and retrieve data. All table creation is lazily done which essentially means that you create an object or key. If it exists, it will add to it. If it doesn’t exist, it will create it.
As for pricing, for free you get a lot of requests (1 million per month), but the downside is that if you tightly integrate too much with Parse, you might have a difficult time making a switch in the future if needed. But, the same goes for any backend that you use even if you opt to create a custom backend or use another service. You might still run in to transition problems.
The main benefit of Parse is that you just leave the infrastructure to the team behind it (now owned by Facebook) and focus your time creating an app how you want it.
If you are a small app developer then take the free account for a spin. If you have a larger app, I suggest reaching out to the team at Parse to discuss technical details such as limits, burst rates etc… The team at Parse indicate it can handle very large amounts of data and requests, so in my opinion it is worth testing unless you prefer the custom route so you get more control.
The Parse service can be found here.