Setting up a cloud database

Our SPA will soon live in the cloud, and it needs to be connected to a database. Moving our application to the cloud requires our database also to be accessible from the Web. Having a database running on your local machine isn't going to cut it.

There are a number of cloud-based database services, but I have found that MongoLab is one of the easiest to set up, use, and maintain. They offer a free sandbox database, which is perfect for development and experimentation. For production-level applications, you'd want to look into a higher subscription rate.

The PaaS we will use to deploy our application, Heroku, plays really well with MongoLab, and even offers Mongolab as a one-click add-on. We will set things up manually ...

Get Mastering JavaScript Single Page Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.