Persistence with Orchestrate
28 Sep 2015Orchestrate.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
- Sign up for an account on orchestrate.io.
- Create an application at the Orchestrate dashboard.
- Create a new node project (new folder,
npm init, etc…). - Install the
orchestrateNode module (npm install --save orchestrate). - Make a JS file that
requiresorchestrateand 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.