OSCON 2012: ql.io and Node.js
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

OSCON 2012: ql.io and Node.js

  • 1,386 views
Uploaded on

OSCON 2012 (July - Portland, OR) presentation by Subbu Allamaraju and myself on ql.io and Node.js

OSCON 2012 (July - Portland, OR) presentation by Subbu Allamaraju and myself on ql.io and Node.js

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,386
On Slideshare
1,384
From Embeds
2
Number of Embeds
1

Actions

Shares
Downloads
12
Comments
0
Likes
0

Embeds 2

http://coderwall.com 2

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
  • If you download the standalone server version of ql.io, it will sit on top of your existing node server (or within your node applications) and be able to query your internal data and/or external data sources
  • 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.
  • First we need some mustache power
  • Route files are also stored with the .ql extension but are placed under the routes directory
  • create table slideshare on select get from "http://www.slideshare.net/rss/user/{user}" resultset "rss.channel";create table github.users on select get from "http://github.com/api/v2/json/user/show/{user}";user = "jcleblanc";slides = select * from slideshare where user="{user}";twitter = select * from github.users where user="{user}";return { "slides": "{slides}", "twitter": "{twitter}"}

Transcript

  • 1. node.js and ql.ioBuild Your Own July 20, 2012 for OSCON HTTP APIs 1
  • 2. SubbuAllamaraju@sallamargithub.com/s3u 2
  • 3. JonLeBlanc@jcleblancgithub.com/jcleblanc 3
  • 4. How to consumeHTTP APIscheaply and 4
  • 5. curl -X <HTTP method> <URI> 5
  • 6. Real code(randomized)
  • 7. 7
  • 8. 8
  • 9. 9
  • 10. 10
  • 11. 11
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. Use case:Find things from AFor each thing, find details fromFor each thing, find more detaMerge results 15
  • 16. Use case:Find productsFind dominant categories of prLook up category infoMerge categories with product 16
  • 17. Use case:Get stuff from AIf A is down, try from BAnnotate stuff with other stuff fIgnore some things from the stJoin all 17
  • 18. Client [Really important client] Why dont you give me an API optimized for my use Producers cases? Server [Really important producer] Thanks. Get a number and stand in the line! 18
  • 19. Client [Really important client] Why dont you give me an API optimized for my use Producers cases? Who gets to decide the right Server thing? [Really important producer] Thanks. Get a number and stand in the line! 19
  • 20. Build Your OwnOptimized APIs 20
  • 21. https://github.com/ql -io/ql.io Platform Engineering 21
  • 22. A domain specificlanguage for HTTPclient programming 22
  • 23. cut down lines of codereduce no of requests save bandwidth 23
  • 24. 24
  • 25. http://ql.io/console 25
  • 26. ql.io Installation ModesWeb Server Node.js 26
  • 27. curl http://<host>/q?s=query 27
  • 28. As a Standalone Server Data(internal ) ql.io Node Host Data(externa l)
  • 29. # As a node.js modulenpm install ql.io-engine
  • 30. // Use ql.io from node.jsvar Engine = require(ql.io-engine);var engine = new Engine({ //OPTIONS});var script = …;engine.execute(script, function(emitter){ emitter.on("end", function(err, res){ … });});
  • 31. Language: Defining a Data SourceInclude in Request Include in .ql file
  • 32. Example: Mustache Templates
  • 33. Example: jQuery for Cross Domain Reqs
  • 34. Let’s Do It!
  • 35. 1. Interop via HTTP2. SQL inspired3. Implicit orchestration4. Failure modes 35
  • 36. code https://github.com/ql-io/ql.iodocs/demos http://ql.io https://github.com/jcleblanc/api-masherblog http://ql-io.github.com 36