• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
High Performance API Mashups with Node.js and ql.io
 

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

on

  • 2,315 views

High Performance API Mashups

High Performance API Mashups

Statistics

Views

Total Views
2,315
Views on SlideShare
2,205
Embed Views
110

Actions

Likes
2
Downloads
16
Comments
1

6 Embeds 110

https://twitter.com 64
http://qa1978.moreix.com 17
http://eventifier.co 12
http://nodeslide.herokuapp.com 8
http://dev.portalfin.com 7
http://nextlogic.moreix.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Mashing up multiple data sourcesPerformance issues
  • Language based on a SQL-like syntax which exports all data to JSON
  • A create table call (to define a data source) may be included in the HTTP request to the ql.io web source or defined in a .ql file, which is added into the /tables directory of your application.
  • create table slideshare on select get from "http://www.slideshare.net/rss/user/{user}" resultset "rss.channel";create table github on select get from "https://api.github.com/users/{user}";user = "jcleblanc";slides = select * from slideshare where user="{user}";person = select * from github where user="{user}";return { "slides": "{slides}", "person": "{person}"}
  • Route files are also stored with the .ql extension but are placed under the routes directory
  • First we need some mustache power
  • Route files are also stored with the .ql extension but are placed under the routes directory
  • -- http://api.hunch.com/api/v1/get-recommendations/?user_id=tw_jcleblanc&topic_id=cat_electronics&limit=5create table hunch on select get from "http://api.hunch.com/api/v1/get-recommendations/?user_id={uid}&topic_ids={tid}&limit={limit}" using defaults limit="20" resultset "recommendations";--select title from hunch where uid="tw_jcleblanc" and tid="cat_electronics";select * from finditems where keywords in (select title from hunch where uid="tw_jcleblanc" and tid="cat_electronics");

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

  • High Performance Mashups Using ql.io and Node.js Jonathan LeBlanc Developer Evangelist (PayPal) Twitter: @jcleblanc | @PayPalDev Github: github.com/jcleblanc
  • 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
  • ql.io: Using the System Standalone Server / Web Endpoint Node.js App
  • Language: Defining a Data Source Include in Request Include in .ql Table
  • ql.io: The Test Console Test Console: http://ql.io/console
  • Language: Including Script Routes 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: Using Script Routescurl --header "content-type: application/x-www-form-urlencoded" -d "user=jcleblanc" http://localhost:3000/social
  • 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
  • Node.js: Installing the Package npm install ql.io-engine
  • Node.js: Including the Engine var Engine = require(ql.io-engine); var engine = new 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? http://www.slideshare.net/jcleblanc Jonathan LeBlanc Developer Evangelist (PayPal) Twitter: @jcleblanc | @PayPalDev Github: github.com/jcleblanc