0
High Performance Mashups               Using ql.io and Node.js                          Jonathan LeBlanc              Deve...
ql.io: The Problem is API Overload
ql.io: Reducing Workload + Processing               Reduced Documentation               Reduced Code Length               ...
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 = sel...
Language: Using Script Routescurl --header "content-type: application/x-www-form-urlencoded"           -d "user=jcleblanc"...
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 ...
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...
Tools: External API Tables    Tables Source:    https://github.com/jcleblanc/ql.io-tables    https://github.com/ql-io/ql.i...
Thank You! Any Questions?        http://www.slideshare.net/jcleblanc                              Jonathan LeBlanc        ...
High Performance API Mashups with Node.js and ql.io
High Performance API Mashups with Node.js and ql.io
High Performance API Mashups with Node.js and ql.io
High Performance API Mashups with Node.js and ql.io
Upcoming SlideShare
Loading in...5
×

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

2,114

Published on

High Performance API Mashups

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,114
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
25
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide
  • 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");
  • Transcript of "High Performance API Mashups with Node.js and ql.io"

    1. 1. High Performance Mashups Using ql.io and Node.js Jonathan LeBlanc Developer Evangelist (PayPal) Twitter: @jcleblanc | @PayPalDev Github: github.com/jcleblanc
    2. 2. ql.io: The Problem is API Overload
    3. 3. ql.io: Reducing Workload + Processing Reduced Documentation Reduced Code Length Reduced Result Syncing
    4. 4. ql.io: Increasing Performance (Requests)
    5. 5. ql.io: Error Handling and Reporting
    6. 6. ql.io: Open Standard Foundation
    7. 7. ql.io: Using the System Standalone Server / Web Endpoint Node.js App
    8. 8. Language: Defining a Data Source Include in Request Include in .ql Table
    9. 9. ql.io: The Test Console Test Console: http://ql.io/console
    10. 10. 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;
    11. 11. Language: Using Script Routescurl --header "content-type: application/x-www-form-urlencoded" -d "user=jcleblanc" http://localhost:3000/social
    12. 12. Example: Mustache Templates
    13. 13. Example: jQuery for Cross Domain Reqs
    14. 14. Let’s Do It!
    15. 15. Tools: API Masher Visualization Engine: https://github.com/jcleblanc/api-masher Technology Backbone – ql.io – jQuery – Mustache Templates
    16. 16. Node.js: Installing the Package npm install ql.io-engine
    17. 17. Node.js: Including the Engine var Engine = require(ql.io-engine); var engine = new Engine({ … });
    18. 18. 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]); }); });
    19. 19. Tools: External API Tables Tables Source: https://github.com/jcleblanc/ql.io-tables https://github.com/ql-io/ql.io- site/tree/master/tables
    20. 20. Thank You! Any Questions? http://www.slideshare.net/jcleblanc Jonathan LeBlanc Developer Evangelist (PayPal) Twitter: @jcleblanc | @PayPalDev Github: github.com/jcleblanc
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×