Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 2.2 KB

00-08-01-orchestrate1-persistence.md

File metadata and controls

56 lines (44 loc) · 2.2 KB
layout title class date
post
Persistence with Orchestrate
persistence
2015-09-27 17:00:00 -0700

Orchestrate.io

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

***Software as a Service***

SAAS (not to be confused with SASS) is a model that's been growing rapidly over the last few years. Rather than maintain your own instance of a library or database, you can subscribe to a platform that manages all that for you. This has some tradeoffs: the people providing the service have time and motivation to learn about all the corner-cases and pitfalls of that problem-domain, but it'll be somewhat slower (and often more expensive) than something you host locally.

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:

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

{%highlight javascript%} db.get('users', 'kates-user-id') .then(function (res) { console.log(res.body); }) .fail(function (err) {}); {%endhighlight%}

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.