SlideShare a Scribd company logo
1 of 34
Consuming HTTP at Scale

       Node Summit, Jan 24, 2012
Hello, I'm
Subbu Allamaraju
      @sallamar
http://www.subbu.org


                       2
Brought to you by


eBay's platform engineering


https://github.com/ql-io/ql.io
Open source (Apache 2)

                              3
[http://blog.programmableweb.com/2011/05/25/api-business-models-then-and-
now/]                                                                  4
A DSL for HTTP
An HTTP gateway
 Built on node.js

                    5
Make HTTP APIs easy
and fast to consume


                      6
Lines of code for API calls   Data size (k)




before



after



                                              7
Lines of code for API calls   Data size (k)




 before




 after

                                              8
How Come?
            9
// HTTP and network coding is already easy
//
var http = require('http');
var client = http.request({
    method : 'GET',
    host : 'my host',
    path : 'my path'}, function(res) {
      res.on('data', function(chunk) { ... };
      res.on('end', function() { ... });
});
client.end();



                                                10
Real code (randomized)
12
13
14
15
16
17
18
The same in ql.io
HFRwni G NIxGNs TSMeb7 A9On vtwZhQoJGnFQFqgkV9 3WFgC
93TbEBy6 Q ocpBxgpH3 Pu4ju fi
                                      (randomized)
ZsKb W RkIs5b z UAsS QK3nyJ68IhTSB0aTufR98ymV evsX7
   tUH 8i4fwR S Hut69mnCHAO
ufyx w CZLOtN 9 PvTU sPd2lMVDV42tRAfIoPM56H1hE tGz5s
kmekNeyrai5SklC 5 TstTKDhFb
   OLy 5KQ5oz A MiZzQJSCbEv
aLr068KLleE X q8cwPm 5 nZpH 3jpeWcIpkTTIjGsZovq7 fR4Hn dz3Lhl o
MfdTDqpFVdh
aiPOsj2fO9 w fWD3mv p ORHX Bq4xIMvLGjMrgnC6JpBw1S5 HDwoI
CwhI09 z 742rMEqx626
ZH0qwtN g boU4fU W QYKf F24BKGrFfg0sfhkc8U4aZfL4bn kUNmG
vm6odt 6 YaC6b0Ff4gG
Ox4Jh0 6
 aXtsEg G LUlJL3k2O
 WeRAMe d 9GlF1XJM8
 9oicQwaHnMp7n U Pjnojj5kdhD0sZzh
 Pz3HHpnBy L OlVQMpHAILCH
 RF3vwaFHarZR Q i2Ofa38U9ylvve
cE

                                                                  19
Mobile and front-end



  requests per UI paint
                        5+
[Jan 2011 ad hoc testing on an iPhone] Bing – 4, Google - 13, Mint – 26,
Netflix – 13, Amazon – 2, LinkedIn 5, Facebook - 9
                                                                           20
Client   Server-1   Server-2   Server-3   Server-4




                                                 max(max(t1+
                                                  t4),t2,t3)




            Fork/join dance
                                                               21
Parallellizing

I/O            Sequencing
               Joining
               Normalizing

Writing such code once or twice is
fun – writing tens of times is not.
                                      22
Native, mobile
Single page apps            Server-1   Server-2   Server-3   Server-4




                   Bad for far-away clients
                                                                        23
Many requests and connections, high
bandwidth use, high latency, low reliability
                                           24
Easy Button
              25
HTTP CRUD to SQLish CRUD
   create table for each resource
   select to read
   insert into to add or create
   update to update
   delete to delete

# HTTP requests with one line of code

select long_url from bitly.shorten
 where shortUrl = 'http://bit.ly/uZIvmY'

select Url from bing.soap.search
  where q = "ql.io"

                                           26
Designed for the lazy
// GET on a resource bound to SELECT
create table bing.search
 on select get from
'http://api.bing.net/xml.aspx?Appid={appid}&query={q}&sources=web'
  using defaults appid = '{config.bing.appid}'
  resultset 'SearchResponse.web:Web.web:Results.web:WebResult';


// POST on a resource bound to SELECT
create table bing.soap.search
 on select post to 'http://api.bing.net/soap.asmx'
   using defaults appid = '{config.bing.appid}'
   using bodyTemplate 'bing.soap.xml.mu'
    type 'application/xml'
   resultset
'soapenv:Envelope.soapenv:Body.SearchResponse.parameters.Web.Results.
WebResult';

                                                                     27
No Async Mind-Bending
# Sequential
minis = select * from finditems where
   keywords = 'mini cooper' limit 10;
return select PictureURL from details where
   itemId = "{minis.itemId}";

# Or parallel
keyword = "ql.io";
web = select * from bing.search where q = "{keyword}";
tweets = select id as id, from_user_name as user_name,
  text as text from twitter.search where q = "ql.io";

return {
  "keyword": "{keyword}",
  "web": "{web}",
  "tweets": "{tweets}"
}

                                                         28
Implicit Fork-Join and Routing
prodid = select ProductID[0].Value from eBay.FindProducts
  where QueryKeywords = 'macbook pro';
details = select * from eBay.ProductDetails where
  ProductID in ('{prodid}') and
  ProductType = 'Reference';
reviews = select * from eBay.ProductReviews where
  ProductID in ('{prodid}') and
  ProductType = 'Reference';

return select d.ProductID[0].Value as id,
   d.Title as title, d.ReviewCount as reviewCount,
   r.ReviewDetails.AverageRating as rating
 from details as d, reviews as r
   where d.ProductID[0].Value = r.ProductID.Value
   via route '/myapi' using method get;



                                                            29
How to Use
             30
As a Gateway
                               ql.io as an
                                  HTTP
Client apps                    Gateway       S-1   S-2   S-3   S-4




          Optional streaming
          through WebSockets




                                                                     31
Node.js Module
/> npm install ql.io-engine

var Engine = require('ql.io-engine'), fs = require('fs');
var engine = new Engine({tables : __dirname + '/../tables'});
var script = fs.readFileSync(__dirname + '/myapi.ql', 'UTF-8');
engine.execute(script, function(emitter) {
    emitter.on('prodid', function(data) {
        console.log('found ' + data.length + ' product IDs');
    });
    emitter.on('details', function(data) {
        console.log('found ' + data.length + ' details');
    });
    emitter.on('reviews', function(data) {
        console.log('found ' + data.length + ' reviews');
    });
    emitter.on('end', function(err, result) {
        console.log('Got results');
    });
});
                                                                  32
mkdir myapp
cd myapp
curl -L "http://tinyurl.com/7cgglby"| bash

bin/start.sh




                                             33
http://ql.io

More Related Content

What's hot

RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueGleicon Moraes
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaJon Moore
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUNCong Zhang
 
Будь первым
Будь первымБудь первым
Будь первымFDConf
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
Kubernetes Tutorial
Kubernetes TutorialKubernetes Tutorial
Kubernetes TutorialCi Jie Li
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-processskumner
 
All you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopAll you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopSaša Tatar
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stackBram Vogelaar
 
Go Containers
Go ContainersGo Containers
Go Containersjgrahamc
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Susan Potter
 
Go debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFxGo debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFxSignalFx
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertorToshiaki Baba
 
How to make a large C++-code base manageable
How to make a large C++-code base manageableHow to make a large C++-code base manageable
How to make a large C++-code base manageablecorehard_by
 

What's hot (20)

RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and Lua
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
 
Будь первым
Будь первымБудь первым
Будь первым
 
Go memory
Go memoryGo memory
Go memory
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Comets notes
Comets notesComets notes
Comets notes
 
Kubernetes Tutorial
Kubernetes TutorialKubernetes Tutorial
Kubernetes Tutorial
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-process
 
tdc2012
tdc2012tdc2012
tdc2012
 
All you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopAll you need to know about the JavaScript event loop
All you need to know about the JavaScript event loop
 
Go Memory
Go MemoryGo Memory
Go Memory
 
EC2
EC2EC2
EC2
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stack
 
Go Containers
Go ContainersGo Containers
Go Containers
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
 
Go debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFxGo debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFx
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
 
Containers for sysadmins
Containers for sysadminsContainers for sysadmins
Containers for sysadmins
 
How to make a large C++-code base manageable
How to make a large C++-code base manageableHow to make a large C++-code base manageable
How to make a large C++-code base manageable
 

Similar to ql.io: Consuming HTTP at Scale

Presto anatomy
Presto anatomyPresto anatomy
Presto anatomyDongmin Yu
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesOdoo
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work TogetherSubbu Allamaraju
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesSreenivas Makam
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...Aman Kohli
 
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021WDDay
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 
Being HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeBeing HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeAman Kohli
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기NAVER D2
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)DongHyeon Kim
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM  Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM Mark Rees
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)Wesley Beary
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...NGINX, Inc.
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLDatabricks
 

Similar to ql.io: Consuming HTTP at Scale (20)

ql.io at NodePDX
ql.io at NodePDXql.io at NodePDX
ql.io at NodePDX
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance Issues
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work Together
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
 
Skydive 5/07/2016
Skydive 5/07/2016Skydive 5/07/2016
Skydive 5/07/2016
 
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Being HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeBeing HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on Purpose
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM  Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM
 
(Re)discover your AEM
(Re)discover your AEM(Re)discover your AEM
(Re)discover your AEM
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Node azure
Node azureNode azure
Node azure
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQL
 

More from Subbu Allamaraju

What Worked for Netflix May Not Work for You (OSCON-2018)
What Worked for Netflix May Not Work for You (OSCON-2018)What Worked for Netflix May Not Work for You (OSCON-2018)
What Worked for Netflix May Not Work for You (OSCON-2018)Subbu Allamaraju
 
Are We Ready for Serverless
Are We Ready for ServerlessAre We Ready for Serverless
Are We Ready for ServerlessSubbu Allamaraju
 
How to Sell Serverless to Your Colleagues
How to Sell Serverless to Your ColleaguesHow to Sell Serverless to Your Colleagues
How to Sell Serverless to Your ColleaguesSubbu Allamaraju
 
Turning Containers into Cattle
Turning Containers into CattleTurning Containers into Cattle
Turning Containers into CattleSubbu Allamaraju
 
Keystone at the Center of Our Universe
Keystone at the Center of Our UniverseKeystone at the Center of Our Universe
Keystone at the Center of Our UniverseSubbu Allamaraju
 
Journey and future of OpenStack eBay and PayPal
Journey and future of OpenStack eBay and PayPalJourney and future of OpenStack eBay and PayPal
Journey and future of OpenStack eBay and PayPalSubbu Allamaraju
 
RESTful Web Apps - Facts vs Fiction
RESTful Web Apps - Facts vs FictionRESTful Web Apps - Facts vs Fiction
RESTful Web Apps - Facts vs FictionSubbu Allamaraju
 

More from Subbu Allamaraju (15)

Five Rules
Five RulesFive Rules
Five Rules
 
Leading a Transformation
Leading a TransformationLeading a Transformation
Leading a Transformation
 
Taming the Rate of Change
Taming the Rate of ChangeTaming the Rate of Change
Taming the Rate of Change
 
What Worked for Netflix May Not Work for You (OSCON-2018)
What Worked for Netflix May Not Work for You (OSCON-2018)What Worked for Netflix May Not Work for You (OSCON-2018)
What Worked for Netflix May Not Work for You (OSCON-2018)
 
Are We Ready for Serverless
Are We Ready for ServerlessAre We Ready for Serverless
Are We Ready for Serverless
 
How to Sell Serverless to Your Colleagues
How to Sell Serverless to Your ColleaguesHow to Sell Serverless to Your Colleagues
How to Sell Serverless to Your Colleagues
 
Turning Containers into Cattle
Turning Containers into CattleTurning Containers into Cattle
Turning Containers into Cattle
 
Keystone at the Center of Our Universe
Keystone at the Center of Our UniverseKeystone at the Center of Our Universe
Keystone at the Center of Our Universe
 
Journey and future of OpenStack eBay and PayPal
Journey and future of OpenStack eBay and PayPalJourney and future of OpenStack eBay and PayPal
Journey and future of OpenStack eBay and PayPal
 
Engineering operations
Engineering operationsEngineering operations
Engineering operations
 
Open stack@ebay
Open stack@ebayOpen stack@ebay
Open stack@ebay
 
Measuring REST
Measuring RESTMeasuring REST
Measuring REST
 
REST: Theory vs Practice
REST: Theory vs PracticeREST: Theory vs Practice
REST: Theory vs Practice
 
RESTful Web Apps - Facts vs Fiction
RESTful Web Apps - Facts vs FictionRESTful Web Apps - Facts vs Fiction
RESTful Web Apps - Facts vs Fiction
 
Pragmatic Rest
Pragmatic RestPragmatic Rest
Pragmatic Rest
 

Recently uploaded

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

ql.io: Consuming HTTP at Scale

  • 1. Consuming HTTP at Scale Node Summit, Jan 24, 2012
  • 2. Hello, I'm Subbu Allamaraju @sallamar http://www.subbu.org 2
  • 3. Brought to you by eBay's platform engineering https://github.com/ql-io/ql.io Open source (Apache 2) 3
  • 5. A DSL for HTTP An HTTP gateway Built on node.js 5
  • 6. Make HTTP APIs easy and fast to consume 6
  • 7. Lines of code for API calls Data size (k) before after 7
  • 8. Lines of code for API calls Data size (k) before after 8
  • 10. // HTTP and network coding is already easy // var http = require('http'); var client = http.request({ method : 'GET', host : 'my host', path : 'my path'}, function(res) { res.on('data', function(chunk) { ... }; res.on('end', function() { ... }); }); client.end(); 10
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19. The same in ql.io HFRwni G NIxGNs TSMeb7 A9On vtwZhQoJGnFQFqgkV9 3WFgC 93TbEBy6 Q ocpBxgpH3 Pu4ju fi (randomized) ZsKb W RkIs5b z UAsS QK3nyJ68IhTSB0aTufR98ymV evsX7 tUH 8i4fwR S Hut69mnCHAO ufyx w CZLOtN 9 PvTU sPd2lMVDV42tRAfIoPM56H1hE tGz5s kmekNeyrai5SklC 5 TstTKDhFb OLy 5KQ5oz A MiZzQJSCbEv aLr068KLleE X q8cwPm 5 nZpH 3jpeWcIpkTTIjGsZovq7 fR4Hn dz3Lhl o MfdTDqpFVdh aiPOsj2fO9 w fWD3mv p ORHX Bq4xIMvLGjMrgnC6JpBw1S5 HDwoI CwhI09 z 742rMEqx626 ZH0qwtN g boU4fU W QYKf F24BKGrFfg0sfhkc8U4aZfL4bn kUNmG vm6odt 6 YaC6b0Ff4gG Ox4Jh0 6 aXtsEg G LUlJL3k2O WeRAMe d 9GlF1XJM8 9oicQwaHnMp7n U Pjnojj5kdhD0sZzh Pz3HHpnBy L OlVQMpHAILCH RF3vwaFHarZR Q i2Ofa38U9ylvve cE 19
  • 20. Mobile and front-end requests per UI paint 5+ [Jan 2011 ad hoc testing on an iPhone] Bing – 4, Google - 13, Mint – 26, Netflix – 13, Amazon – 2, LinkedIn 5, Facebook - 9 20
  • 21. Client Server-1 Server-2 Server-3 Server-4 max(max(t1+ t4),t2,t3) Fork/join dance 21
  • 22. Parallellizing I/O Sequencing Joining Normalizing Writing such code once or twice is fun – writing tens of times is not. 22
  • 23. Native, mobile Single page apps Server-1 Server-2 Server-3 Server-4 Bad for far-away clients 23
  • 24. Many requests and connections, high bandwidth use, high latency, low reliability 24
  • 26. HTTP CRUD to SQLish CRUD  create table for each resource  select to read  insert into to add or create  update to update  delete to delete # HTTP requests with one line of code select long_url from bitly.shorten where shortUrl = 'http://bit.ly/uZIvmY' select Url from bing.soap.search where q = "ql.io" 26
  • 27. Designed for the lazy // GET on a resource bound to SELECT create table bing.search on select get from 'http://api.bing.net/xml.aspx?Appid={appid}&query={q}&sources=web' using defaults appid = '{config.bing.appid}' resultset 'SearchResponse.web:Web.web:Results.web:WebResult'; // POST on a resource bound to SELECT create table bing.soap.search on select post to 'http://api.bing.net/soap.asmx' using defaults appid = '{config.bing.appid}' using bodyTemplate 'bing.soap.xml.mu' type 'application/xml' resultset 'soapenv:Envelope.soapenv:Body.SearchResponse.parameters.Web.Results. WebResult'; 27
  • 28. No Async Mind-Bending # Sequential minis = select * from finditems where keywords = 'mini cooper' limit 10; return select PictureURL from details where itemId = "{minis.itemId}"; # Or parallel keyword = "ql.io"; web = select * from bing.search where q = "{keyword}"; tweets = select id as id, from_user_name as user_name, text as text from twitter.search where q = "ql.io"; return { "keyword": "{keyword}", "web": "{web}", "tweets": "{tweets}" } 28
  • 29. Implicit Fork-Join and Routing prodid = select ProductID[0].Value from eBay.FindProducts where QueryKeywords = 'macbook pro'; details = select * from eBay.ProductDetails where ProductID in ('{prodid}') and ProductType = 'Reference'; reviews = select * from eBay.ProductReviews where ProductID in ('{prodid}') and ProductType = 'Reference'; return select d.ProductID[0].Value as id, d.Title as title, d.ReviewCount as reviewCount, r.ReviewDetails.AverageRating as rating from details as d, reviews as r where d.ProductID[0].Value = r.ProductID.Value via route '/myapi' using method get; 29
  • 31. As a Gateway ql.io as an HTTP Client apps Gateway S-1 S-2 S-3 S-4 Optional streaming through WebSockets 31
  • 32. Node.js Module /> npm install ql.io-engine var Engine = require('ql.io-engine'), fs = require('fs'); var engine = new Engine({tables : __dirname + '/../tables'}); var script = fs.readFileSync(__dirname + '/myapi.ql', 'UTF-8'); engine.execute(script, function(emitter) { emitter.on('prodid', function(data) { console.log('found ' + data.length + ' product IDs'); }); emitter.on('details', function(data) { console.log('found ' + data.length + ' details'); }); emitter.on('reviews', function(data) { console.log('found ' + data.length + ' reviews'); }); emitter.on('end', function(err, result) { console.log('Got results'); }); }); 32
  • 33. mkdir myapp cd myapp curl -L "http://tinyurl.com/7cgglby"| bash bin/start.sh 33