Your SlideShare is downloading. ×
  • Like
High Performance API Mashups with Node.js and ql.io
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

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

  • 1,846 views
Published

High Performance API Mashups

High Performance API Mashups

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
1,846
On SlideShare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
20
Comments
1
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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

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