Using MongoDB in the cloud

Today, we have many options to work with MongoDB, from in-house services to hosting companies that provide Platform as a Service (PaaS) and Software as a Service (SaaS).

We will present a solution called Database as a Service (DbaaS) that provides database services for highly scalable web applications.

Here's a simple step-by-step process to start using a MongoDB instance with a cloud service:

  1. Go to https://www.compose.io/.
  2. Create your free account.
  3. On your dashboard panel, click on add Database.
  4. On the right-hand side, choose Sandbox Database.
  5. Name your database as node-api.
  6. Add a user to your database.
  7. Go back to your database title, click on admin.
  8. Copy the connection string.
  9. The string connection looks like this:
    mongodb://<user>:<password>@kahana.mongohq.com:10073/node-api. ...

Get Learning Single-page Web 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.