1 / 36

OSCON 2012: ql.io and Node.js

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

jcleblanc
Télécharger la présentation

OSCON 2012: ql.io and Node.js

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. node.js and ql.io Build Your Own HTTP APIs for Agility and Scale OSCON July 20, 2012 1

  2. Subbu Allamaraju @sallamar github.com/ s3u 2

  3. Jon LeBlanc @jcleblanc github.com/jcle blanc 3

  4. How to consume HTTP APIs cheaply and efficiently 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 A For each thing, find details from B For each thing, find more details from C Merge results 15

  16. Use case: Find products Find dominant categories of products Look up category info Merge categories with products 16

  17. Use case: Get stuff from A If A is down, try from B Annotate stuff with other stuff from C Ignore some things from the stuff Join all 17

  18. Client [Really important client] Why don't you give me an API optimized for my use cases? Producers Server [Really important producer] Thanks. Get a number and stand in the line! 18

  19. Client [Really important client] Why don't you give me an API optimized for my use cases? Producers Server Who gets to decide the right thing? [Really important producer] Thanks. Get a number and stand in the line! 19

  20. Build Your Own Optimized APIs 20

  21. https://github.com/ql -io/ql.io Platform Engineering 21

  22. A domain specific language for HTTP client programming 22

  23. cut down lines of code reduce no of requests save bandwidth 23

  24. 24

  25. http://ql.io/console 25

  26. ql.io Installation Modes Web 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 module npm install ql.io-engine

  30. // Use ql.io from node.js var 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 Source Include 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 HTTP 2. SQL inspired 3. Implicit orchestration 4. Failure modes 5. Consumer 35

  36. code https://github.com/ql-io/ql.io docs/demos http://ql.io https://github.com/jcleblanc/ api-masher blog http://ql-io.github.com 36

More Related