What is Parse.com ?
- Backend for apps and websites
- Store key/value data (think NoSQL in the cloud)
- Store Any Files (Text, Image, PDF, etc)
- Free for most of us.
- User Management
- Account creation w/o optional email verification.
- Social Network Sign-in integration
- Easy Push Notifications
- Location Stuff.
So, how’s this work?
Think about this for a minute. Traditionally, you set up a server-side stack (LAMP, or RoR, ASP.NET, or something else), set up a database, and then interact with it via Ajax on the client. Parse just reduced all that work to a few lines of code.
Using Parse for Your Web-based Projects
Before we start, let’s take a minute and think how a traditional app could be created:
- You would create a MySQL/Oracle database.
- You may have a PHP/Java/ASP.NET class that is responsible for performing CRUD operations. Optionally, you could just have a bunch of functions.
- You would need to sanitize the input to protect against XSS attacks, as well as worry about database security in general.
- If a collaborative app, you would need to track different users and manage their lists. More code, more tables, and more schemas.
- You would need to make sure your database stays performant.
You get the idea. There’s a lot to think about and many areas to make mistakes. Parse handles these issues for us.
Create a Parse Account
Before you do anything, create a free Parse account. Then create a new app.
Download the Empty Project
Download the Blank Project with SDK from Downloads (Top Menu). The .zip file will contain index.html and css folder
Go to Dashboard > “Friends List” Application > Settings Tab > Application Keys
This file contains the Parse object that we will interact with.
Browser View of index.html
Data Stored on Parse:
Parse has five types of classes:
- User classes store user-specific information, and Parse provides sugar methods such as signUp(), login(), and more to help with user administration.
- Installation classes are typically used to send push notifications for mobile apps. Yes, Parse supports push notifications to all clients.
- Role classes help segregate users into specific roles, controlling access to read/write to other classes. This is called ACL (access control list) within Parse.
- Product classes store in-app product data.
- Custom classes are for anything else.
Pros and Cons
I want to stress is that Parse is not suitable for every type of project. Although the free plan is very generous, Parse is a paid service. It can get expensive if you go above certain limits. Luckily, the pricing model is very transparent, and you should be able to figure out how much your app can cost. Generally speaking, I use it for smaller projects where I can anticipate a certain cap when it comes to the number of API requests that I make. I have yet to try Parse for a large project.
One common issue with a service such as Parse is the lock-in effect.
If you use Parse for a small project that suddenly takes off, it can be difficult to move to a difference service or platform. As you can imagine, replacing Parse with your own back-end would entail a significant amount of refactoring. This doesn’t mean you shouldn’t use Parse, but it’s something to keep in mind.
In this tutorial, we looked at how we can use Parse to create a relatively simple web application. I encourage you give the service a try, and make your own decision! Thanks.