PCS JS Immersion

Persistence with Orchestrate

Orchestrate.io

Today we'll learn about Orchestrate.io, a database-as-a-service.

The Orchestrate API

Orchestrate.io stores all your data in its own database. You retrieve data by making HTTP requests to their web API. They offer a Node package to interact with their API without having to craft raw HTTP requests. It's fairly straightforward:

db.put('users', 'kates-user-id', {
  "name": "Kate Robbins",
  "hometown": "Portland, OR",
  "twitter": "@katesfaketwitter"
})
.then(function (res) {
  console.log(res.statusCode);
})
.fail(function (err) {});
db.get('users', 'kates-user-id')
.then(function (res) {
  console.log(res.body);
})
.fail(function (err) {});

Exercise: Orchestrate.io

  1. Sign up for an account on orchestrate.io.
  2. Create an application at the Orchestrate dashboard.
  3. Create a new node project (new folder, npm init, etc…).
  4. Install the orchestrate Node module (npm install --save orchestrate).
  5. Make a JS file that requires orchestrate and uses its API to create and delete some records. Check out the api docs for more on how to work with the API through the Node client.