high performance api mashups with node.js and ql.io
Post on 28-Jan-2015
122 Views
Preview:
DESCRIPTION
TRANSCRIPT
Using ql.io and Node.js
High Performance Mashups
Jonathan LeBlancDeveloper Evangelist (PayPal)
Twitter: @jcleblanc | @PayPalDev
Github: github.com/jcleblanc
The Pro
blem
ql.io: The Problem is API Overload
ql.io: Reducing Workload + Processing
Reduced Documentation
Reduced Code Length
Reduced Result Syncing
ql.io: Increasing Performance (Requests)
ql.io: Error Handling and Reporting
ql.io: Open Standard Foundation
API Mash
ups
ql.io: Using the System
Standalone Server / Node.js AppWeb Endpoint
Language: Defining a Data Source
Include in .ql TableInclude in Request
Test Console: http://ql.io/console
ql.io: The Test Console
user = "jcleblanc";slides = select * from slideshare where user="{user}";twitter = select * from github.users where user="{user}"; return { "slides": "{slides}", "twitter": "{twitter}"} via route '/social' using method post;
Language: Including Script Routes
curl --header "content-type: application/x-www-form-urlencoded"
-d "user=jcleblanc" http://localhost:3000/social
Language: Using Script Routes
Adding D
ispla
y Ele
ments
Example: Mustache Templates
Example: jQuery for Cross Domain Reqs
Let’s Do It!
Tools: API Masher
Visualization Engine: https://github.com/jcleblanc/api-masher
Technology Backbone– ql.io– jQuery–Mustache Templates
Work
ing w
ith N
ode.js
npm install ql.io-engine
Node.js: Installing the Package
var Engine = require('ql.io-engine');var engine = new Engine({ … });
Node.js: Including the Engine
Node.js: Invoking the Engine
var script = "select * from …";
engine.execute(script, function(emitter){ emitter.on("end", function(err, res){ console.log(res['body'][0]); });});
Tools: External API Tables
Tables Source:
https://github.com/jcleblanc/ql.io-tables
https://github.com/ql-io/ql.io-site/tree/master/tables
Thank You! Any Questions?
Jonathan LeBlancDeveloper Evangelist (PayPal)
Twitter: @jcleblanc | @PayPalDev
Github: github.com/jcleblanc
http://www.slideshare.net/jcleblanc
top related