24
Using ql.io and Node.js High Performance Mashups Jonathan LeBlanc Developer Evangelist (PayPal) Twitter: @jcleblanc | @PayPalDev Github: github.com/jcleblanc

High Performance API Mashups with Node.js and ql.io

Embed Size (px)

DESCRIPTION

High Performance API Mashups

Citation preview

Page 1: High Performance API Mashups with Node.js and ql.io

Using ql.io and Node.js

High Performance Mashups

Jonathan LeBlancDeveloper Evangelist (PayPal)

Twitter: @jcleblanc | @PayPalDev

Github: github.com/jcleblanc

Page 2: High Performance API Mashups with Node.js and ql.io

The Pro

blem

Page 3: High Performance API Mashups with Node.js and ql.io

ql.io: The Problem is API Overload

Page 4: High Performance API Mashups with Node.js and ql.io

ql.io: Reducing Workload + Processing

Reduced Documentation

Reduced Code Length

Reduced Result Syncing

Page 5: High Performance API Mashups with Node.js and ql.io

ql.io: Increasing Performance (Requests)

Page 6: High Performance API Mashups with Node.js and ql.io

ql.io: Error Handling and Reporting

Page 7: High Performance API Mashups with Node.js and ql.io

ql.io: Open Standard Foundation

Page 8: High Performance API Mashups with Node.js and ql.io

API Mash

ups

Page 9: High Performance API Mashups with Node.js and ql.io

ql.io: Using the System

Standalone Server / Node.js AppWeb Endpoint

Page 10: High Performance API Mashups with Node.js and ql.io

Language: Defining a Data Source

Include in .ql TableInclude in Request

Page 11: High Performance API Mashups with Node.js and ql.io

Test Console: http://ql.io/console

ql.io: The Test Console

Page 12: High Performance API Mashups with Node.js and ql.io

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

Page 13: High Performance API Mashups with Node.js and ql.io

curl --header "content-type: application/x-www-form-urlencoded"

-d "user=jcleblanc" http://localhost:3000/social

Language: Using Script Routes

Page 14: High Performance API Mashups with Node.js and ql.io

Adding D

ispla

y Ele

ments

Page 15: High Performance API Mashups with Node.js and ql.io

Example: Mustache Templates

Page 16: High Performance API Mashups with Node.js and ql.io

Example: jQuery for Cross Domain Reqs

Page 17: High Performance API Mashups with Node.js and ql.io

Let’s Do It!

Page 18: High Performance API Mashups with Node.js and ql.io

Tools: API Masher

Visualization Engine: https://github.com/jcleblanc/api-masher

Technology Backbone– ql.io– jQuery–Mustache Templates

Page 19: High Performance API Mashups with Node.js and ql.io

Work

ing w

ith N

ode.js

Page 20: High Performance API Mashups with Node.js and ql.io

npm install ql.io-engine

Node.js: Installing the Package

Page 21: High Performance API Mashups with Node.js and ql.io

var Engine = require('ql.io-engine');var engine = new Engine({ … });

Node.js: Including the Engine

Page 22: High Performance API Mashups with Node.js and ql.io

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]); });});

Page 23: High Performance API Mashups with Node.js and ql.io

Tools: External API Tables

Tables Source:

https://github.com/jcleblanc/ql.io-tables

https://github.com/ql-io/ql.io-site/tree/master/tables

Page 24: High Performance API Mashups with Node.js and ql.io

Thank You! Any Questions?

Jonathan LeBlancDeveloper Evangelist (PayPal)

Twitter: @jcleblanc | @PayPalDev

Github: github.com/jcleblanc

http://www.slideshare.net/jcleblanc