Comet: by pushing server data, we push the web forward

NOLOH LLC.
NOLOH LLC.NOLOH LLC.
By Pushing Server Data,By Pushing Server Data,
We Push the Web ForwardWe Push the Web Forward
Presented by
Philip Ross
CometComet
co-founder of
Who Am I
• Co-Founder of NOLOH
– Awesome web development platform
– Engineer there about 6 years
– Architected and developed their Comet functionality
– Along the way, came up with some possibly interesting ideas
(and working prototypes) of my own
• Contributor to php | architect
• Hobbies
– Mathematical logic, set theory, etc...
– Cheese and beer
– Going to cool places like Barcelona
Whoa! Deep, man...
Whoa! Deep, man...
My Talk
• Trying something different
• Not that many implementation details
History of Comet
History of Comet - HTTP
• Web's conventional client
request (or "pull") of data
–HTTP
History of Comet – Server Push
• Server push of certain
available data to client
– AJAX
– Web 2.0 movement = "Comet"
(Alex Russell, 2006)
History of Comet – Early Solutions
• Netscape 1.1 native support
(1995!)
• Java applets
Usefulness
Niche Applications
• E-mail web client
• Webchat
• Collaboration tools
• Games
• To show a pointless, yet dazzling, demo during
your Comet talk at a PHP convention!
Broader Applications
• News / Blogs
• Forums
• Everything with content, really!
• A better every-day web user experience
Why Isn’t It Everywhere?
• Way too difficult to implement
• Not at all approachable to the less skilled
developers
• Comet discussions keep focusing on the low-
level implementation details
• Wheel is constantly reinvented
• Insufficient progress in the direction of
abstraction
Costs
Costs
• Honestly, server hit can
sometimes get significant
– Bandwidth
– Network
– CPU
– Memory
Costs
• Highly depends on the problem
parameters / specs
–Scalability
–Freshness of data
–Frequency of changes
•period = 1 / frequency
Costs
• Demands on client
environment
• Implementation labor!
Many Ways to Skin a Cat
Many Ways to Skin a Cat
• Various different implementations /
"transport protocols"
– Unique advantages and appropriate
times to use them
• Polling, Long Polling, Streaming,
Web Sockets
– Specific implementations (e.g., page
streaming vs. service streaming)
Polling
Polling
• Client periodically connects to
server to check for updates
• Many connections implies that
the largest hit to server
performance will be of the
network variety
Polling
• The lowerlower the duration is than
the period,
the poorerpoorer the performance will
quickly become
• The higherhigher the duration is than
the period,
the poorerpoorer the freshness of data
Polling
• Supported everywhere
• Very easy to implement
• Good solution for low freshness /
low frequency needs
Long Polling
Long Polling
• Client connects to server, but
keeps connection open until
server has an update
• After update, connection is
closed, and after a duration, the
process is repeated
Long Polling
• Many simultaneous pending
connections means server CPU
and memory might take a hit
• As frequency becomes high, long
polling becomes like polling,
taking a considerable network hit
on server
Long Polling
• Supported almost everywhere
• Not that hard to implement
• Solid, reliable choice for many
applications
Streaming
Streaming
• Client connects to server and
stays connected for as long as it
can
• Server keeps feeding updates
through the same connection as
they become available
Streaming
• Many simultaneous pending
connections means server CPU
and memory might take a hit
• Very efficient network-wise
• Great for high-frequency (almost
real-time) applications
Streaming
• Not supported by servers that can't flush
output buffers
• Nightmare to implement
– Different browsers require various
different hacks
– IE requires altogether different "htmlfile"
solution
HTML5 Web Sockets
HTML5 Web Sockets
• Browser can actually open and listen on ports,
effectively trading the client/server role as it
sees fit
• Server can contact browser directly, precisely
when necessary without extra overhead
• Perfect for low-medium frequency
applications
– For real-time levels, streaming might still be the way to go
HTML5 Web Sockets
• Currently in "Working Draft" phase
• Support remains extremely limited
• Even when supported in all browsers,
supporting legacy browsers will still be an issue
Grid courtesy of http://caniuse.com/
How I Think Frameworks Should Do It
How I Think Frameworks Should Do It
• No necessary server installation
– Supporting servers optionally is nice
• Support for all reasonably major browsers
(e.g., IE6+)
• Since different transport protocols are fit for
different applications, they should all be
supported
– ContrastContrast: many tools today support only long
polling
How I Think Frameworks Should Do It
• Hide / abstract away as much of the communication
layer as possible
– ContrastContrast: many tools are server-only or client-only.
Developer must still be very aware of the extreme
complexities of client/server interaction
• Hide / abstract away as much of the data layer as
possible
– Developer merely indicates where the data is
– Rely on framework to detect when data has changed
– Event-driven: Have the framework invoke your callback
– ContrastContrast: many tools require reuse of same data logic
Comet Frameworks
• XAJAX Comet plugin
• phet
• phpwebsocket
• websocket.js
• jQuery plugin
• socket.io and node.js
• jWebSocket
• NOLOH
How NOLOH Does It
How NOLOH Does It
• Listener Control
– Intended to listen to a source of data, and upon
detecting changes, it triggers some defined
method
– A very unintimidating thing to throw into any
application for developers of a very wide range of
skill levels
How NOLOH Does It
• Source property
– File, database query, web service, a method that
returns data, or you can write your own
• Update property (Event)
– Gets triggered upon detecting changes
• Transport property [optional]
– Currently can be: Polling, Long Polling, or
Streaming. Others are on the way
Original Research
Original Research
• Similar to polling except server will not
actually establish connection with browser
when there are no updates
• Server will protect itself from browser
connections in the same way firewalls protect
against denial-of-service attacks
• When server has updates, then it will listen to
browsers
Original Research
• Great for low-medium frequency
applications
–Especially in the absence of availability of
web sockets
• Still experimental, but early tests look
promising
Questions
¿ ?
• Check out NOLOH
– http://www.noloh.com
– Intro talk “High Performance WebApps Faster &
Easier with NOLOH” tomorrow by Asher Snyder
• Contact me at pross@noloh.com
Thank You
Presented by
Philip Ross
1 of 44

Recommended

Resource loading, prioritization, HTTP/2 - oh my! by
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Patrick Meenan
1.9K views40 slides
HTTP/2 Prioritization by
HTTP/2 PrioritizationHTTP/2 Prioritization
HTTP/2 PrioritizationPatrick Meenan
3.1K views68 slides
Membase East Coast Meetups by
Membase East Coast MeetupsMembase East Coast Meetups
Membase East Coast MeetupsMembase
971 views39 slides
Membase Meetup - Silicon Valley by
Membase Meetup - Silicon ValleyMembase Meetup - Silicon Valley
Membase Meetup - Silicon ValleyMembase
609 views48 slides
Apache con2016final by
Apache con2016final Apache con2016final
Apache con2016final Salesforce
1.8K views32 slides
Http2 in practice by
Http2 in practiceHttp2 in practice
Http2 in practicePatrick Meenan
2.9K views169 slides

More Related Content

What's hot

Apache BookKeeper Distributed Store- a Salesforce use case by
Apache BookKeeper Distributed Store- a Salesforce use caseApache BookKeeper Distributed Store- a Salesforce use case
Apache BookKeeper Distributed Store- a Salesforce use caseSalesforce Engineering
1.6K views40 slides
Olympya web-tools 2011 by
Olympya web-tools 2011Olympya web-tools 2011
Olympya web-tools 2011Paulo Mattos
148 views21 slides
Adding Real-time Features to PHP Applications by
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
2.5K views78 slides
4th Lecture: JSP and such by
4th Lecture:  JSP and such4th Lecture:  JSP and such
4th Lecture: JSP and suchManolis Vavalis
548 views32 slides
Cloud Messaging Service: Technical Overview by
Cloud Messaging Service: Technical OverviewCloud Messaging Service: Technical Overview
Cloud Messaging Service: Technical OverviewMessaging Meetup
1.7K views25 slides
20130714 php matsuri - highly available php by
20130714   php matsuri - highly available php20130714   php matsuri - highly available php
20130714 php matsuri - highly available phpGraham Weldon
597 views57 slides

What's hot(20)

Apache BookKeeper Distributed Store- a Salesforce use case by Salesforce Engineering
Apache BookKeeper Distributed Store- a Salesforce use caseApache BookKeeper Distributed Store- a Salesforce use case
Apache BookKeeper Distributed Store- a Salesforce use case
Olympya web-tools 2011 by Paulo Mattos
Olympya web-tools 2011Olympya web-tools 2011
Olympya web-tools 2011
Paulo Mattos148 views
Adding Real-time Features to PHP Applications by Ronny López
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
Ronny López2.5K views
Cloud Messaging Service: Technical Overview by Messaging Meetup
Cloud Messaging Service: Technical OverviewCloud Messaging Service: Technical Overview
Cloud Messaging Service: Technical Overview
Messaging Meetup1.7K views
20130714 php matsuri - highly available php by Graham Weldon
20130714   php matsuri - highly available php20130714   php matsuri - highly available php
20130714 php matsuri - highly available php
Graham Weldon597 views
Advanced queries on the Infinispan Data Grid by C2B2 Consulting
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
C2B2 Consulting2.2K views
Hands-on Performance Tuning Lab - Devoxx Poland by C2B2 Consulting
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
C2B2 Consulting2K views
Infinspan: In-memory data grid meets NoSQL by Manik Surtani
Infinspan: In-memory data grid meets NoSQLInfinspan: In-memory data grid meets NoSQL
Infinspan: In-memory data grid meets NoSQL
Manik Surtani3.1K views
IWMW 1997: Database-WWW Integration by IWMW
IWMW 1997: Database-WWW IntegrationIWMW 1997: Database-WWW Integration
IWMW 1997: Database-WWW Integration
IWMW 386 views
Scaling High Traffic Web Applications by Achievers Tech
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
Achievers Tech4.2K views
Lo4 by liankei
Lo4Lo4
Lo4
liankei59 views
Introduction to WebSockets Presentation by Julien LaPointe
Introduction to WebSockets PresentationIntroduction to WebSockets Presentation
Introduction to WebSockets Presentation
Julien LaPointe5K views
Profiling and Tuning a Web Application - The Dirty Details by Achievers Tech
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
Achievers Tech8K views
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek) by Panagiotis Kanavos
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)
Panagiotis Kanavos819 views
Esc 209 slides-doin by Jonny Doin
Esc 209 slides-doinEsc 209 slides-doin
Esc 209 slides-doin
Jonny Doin160 views

Similar to Comet: by pushing server data, we push the web forward

StoryCode Tech Immersion 1 by
StoryCode Tech Immersion 1StoryCode Tech Immersion 1
StoryCode Tech Immersion 1storycode
721 views9 slides
Web Fendamentals by
Web FendamentalsWeb Fendamentals
Web FendamentalsHiren Mistry
539 views36 slides
From Device to Data Center to Insights by
From Device to Data Center to InsightsFrom Device to Data Center to Insights
From Device to Data Center to InsightsDataWorks Summit/Hadoop Summit
1.9K views58 slides
From Device to Data Center to Insights: Architectural Considerations for the ... by
From Device to Data Center to Insights: Architectural Considerations for the ...From Device to Data Center to Insights: Architectural Considerations for the ...
From Device to Data Center to Insights: Architectural Considerations for the ...P. Taylor Goetz
324 views58 slides
Mobile gotcha by
Mobile gotchaMobile gotcha
Mobile gotchaphegaro
4.1K views48 slides
Cloud Services Powered by IBM SoftLayer and NetflixOSS by
Cloud Services Powered by IBM SoftLayer and NetflixOSSCloud Services Powered by IBM SoftLayer and NetflixOSS
Cloud Services Powered by IBM SoftLayer and NetflixOSSaspyker
4.1K views61 slides

Similar to Comet: by pushing server data, we push the web forward(20)

StoryCode Tech Immersion 1 by storycode
StoryCode Tech Immersion 1StoryCode Tech Immersion 1
StoryCode Tech Immersion 1
storycode721 views
From Device to Data Center to Insights: Architectural Considerations for the ... by P. Taylor Goetz
From Device to Data Center to Insights: Architectural Considerations for the ...From Device to Data Center to Insights: Architectural Considerations for the ...
From Device to Data Center to Insights: Architectural Considerations for the ...
P. Taylor Goetz324 views
Mobile gotcha by phegaro
Mobile gotchaMobile gotcha
Mobile gotcha
phegaro4.1K views
Cloud Services Powered by IBM SoftLayer and NetflixOSS by aspyker
Cloud Services Powered by IBM SoftLayer and NetflixOSSCloud Services Powered by IBM SoftLayer and NetflixOSS
Cloud Services Powered by IBM SoftLayer and NetflixOSS
aspyker4.1K views
What ya gonna do? by CQD
What ya gonna do?What ya gonna do?
What ya gonna do?
CQD364 views
Web Planning an Effective Integration with a 3rd party API to Scale by brettwise
Web Planning an Effective Integration with a 3rd party API to ScaleWeb Planning an Effective Integration with a 3rd party API to Scale
Web Planning an Effective Integration with a 3rd party API to Scale
brettwise213 views
www | HTTP | HTML - Tutorial by MSA Technosoft
www | HTTP | HTML - Tutorialwww | HTTP | HTML - Tutorial
www | HTTP | HTML - Tutorial
MSA Technosoft208 views
Measuring CDN performance and why you're doing it wrong by Fastly
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrong
Fastly8.2K views
CNIT 129S: Ch 3: Web Application Technologies by Sam Bowne
CNIT 129S: Ch 3: Web Application TechnologiesCNIT 129S: Ch 3: Web Application Technologies
CNIT 129S: Ch 3: Web Application Technologies
Sam Bowne1.2K views
Going Mobile with HTML5 by John Reiser
Going Mobile with HTML5Going Mobile with HTML5
Going Mobile with HTML5
John Reiser2K views
Html5 web sockets - Brad Drysdale - London Web 2011-10-20 by Nathan O'Hanlon
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Nathan O'Hanlon1.8K views
CNIT 129S - Ch 3: Web Application Technologies by Sam Bowne
CNIT 129S - Ch 3: Web Application TechnologiesCNIT 129S - Ch 3: Web Application Technologies
CNIT 129S - Ch 3: Web Application Technologies
Sam Bowne963 views
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn by LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInJay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
LinkedIn3.7K views
Building Scalable Big Data Infrastructure Using Open Source Software Presenta... by ssuserd3a367
Building Scalable Big Data Infrastructure Using Open Source Software Presenta...Building Scalable Big Data Infrastructure Using Open Source Software Presenta...
Building Scalable Big Data Infrastructure Using Open Source Software Presenta...
ssuserd3a36711 views
RESTful web by Alvin Qi
RESTful webRESTful web
RESTful web
Alvin Qi2.1K views
Realtime traffic analyser by Alex Moskvin
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
Alex Moskvin174 views
Testing Below the Application by Ash Winter
Testing Below the ApplicationTesting Below the Application
Testing Below the Application
Ash Winter81 views

Recently uploaded

Cencora Executive Symposium by
Cencora Executive SymposiumCencora Executive Symposium
Cencora Executive Symposiummarketingcommunicati21
160 views14 slides
Cocktail of Environments. How to Mix Test and Development Environments and St... by
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...Aleksandr Tarasov
23 views135 slides
What is Authentication Active Directory_.pptx by
What is Authentication Active Directory_.pptxWhat is Authentication Active Directory_.pptx
What is Authentication Active Directory_.pptxHeenaMehta35
15 views7 slides
"Surviving highload with Node.js", Andrii Shumada by
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
58 views29 slides
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf by
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfAdopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfMichaelOLeary82
13 views74 slides
Mobile Core Solutions & Successful Cases.pdf by
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdfIPLOOK Networks
14 views7 slides

Recently uploaded(20)

Cocktail of Environments. How to Mix Test and Development Environments and St... by Aleksandr Tarasov
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...
What is Authentication Active Directory_.pptx by HeenaMehta35
What is Authentication Active Directory_.pptxWhat is Authentication Active Directory_.pptx
What is Authentication Active Directory_.pptx
HeenaMehta3515 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays58 views
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf by MichaelOLeary82
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfAdopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
MichaelOLeary8213 views
Mobile Core Solutions & Successful Cases.pdf by IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks14 views
Optimizing Communication to Optimize Human Behavior - LCBM by Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar38 views
AI + Memoori = AIM by Memoori
AI + Memoori = AIMAI + Memoori = AIM
AI + Memoori = AIM
Memoori14 views
Innovation & Entrepreneurship strategies in Dairy Industry by PervaizDar1
Innovation & Entrepreneurship strategies in Dairy IndustryInnovation & Entrepreneurship strategies in Dairy Industry
Innovation & Entrepreneurship strategies in Dairy Industry
PervaizDar135 views
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... by BookNet Canada
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
BookNet Canada41 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue108 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue199 views
Deep Tech and the Amplified Organisation: Core Concepts by Holonomics
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core Concepts
Holonomics17 views
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
AIM102-S_Cognizant_CognizantCognitive by PhilipBasford
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitive
PhilipBasford21 views
Initiating and Advancing Your Strategic GIS Governance Strategy by Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software184 views

Comet: by pushing server data, we push the web forward

  • 1. By Pushing Server Data,By Pushing Server Data, We Push the Web ForwardWe Push the Web Forward Presented by Philip Ross CometComet co-founder of
  • 2. Who Am I • Co-Founder of NOLOH – Awesome web development platform – Engineer there about 6 years – Architected and developed their Comet functionality – Along the way, came up with some possibly interesting ideas (and working prototypes) of my own • Contributor to php | architect • Hobbies – Mathematical logic, set theory, etc... – Cheese and beer – Going to cool places like Barcelona Whoa! Deep, man... Whoa! Deep, man...
  • 3. My Talk • Trying something different • Not that many implementation details
  • 5. History of Comet - HTTP • Web's conventional client request (or "pull") of data –HTTP
  • 6. History of Comet – Server Push • Server push of certain available data to client – AJAX – Web 2.0 movement = "Comet" (Alex Russell, 2006)
  • 7. History of Comet – Early Solutions • Netscape 1.1 native support (1995!) • Java applets
  • 9. Niche Applications • E-mail web client • Webchat • Collaboration tools • Games • To show a pointless, yet dazzling, demo during your Comet talk at a PHP convention!
  • 10. Broader Applications • News / Blogs • Forums • Everything with content, really! • A better every-day web user experience
  • 11. Why Isn’t It Everywhere? • Way too difficult to implement • Not at all approachable to the less skilled developers • Comet discussions keep focusing on the low- level implementation details • Wheel is constantly reinvented • Insufficient progress in the direction of abstraction
  • 12. Costs
  • 13. Costs • Honestly, server hit can sometimes get significant – Bandwidth – Network – CPU – Memory
  • 14. Costs • Highly depends on the problem parameters / specs –Scalability –Freshness of data –Frequency of changes •period = 1 / frequency
  • 15. Costs • Demands on client environment • Implementation labor!
  • 16. Many Ways to Skin a Cat
  • 17. Many Ways to Skin a Cat • Various different implementations / "transport protocols" – Unique advantages and appropriate times to use them • Polling, Long Polling, Streaming, Web Sockets – Specific implementations (e.g., page streaming vs. service streaming)
  • 19. Polling • Client periodically connects to server to check for updates • Many connections implies that the largest hit to server performance will be of the network variety
  • 20. Polling • The lowerlower the duration is than the period, the poorerpoorer the performance will quickly become • The higherhigher the duration is than the period, the poorerpoorer the freshness of data
  • 21. Polling • Supported everywhere • Very easy to implement • Good solution for low freshness / low frequency needs
  • 23. Long Polling • Client connects to server, but keeps connection open until server has an update • After update, connection is closed, and after a duration, the process is repeated
  • 24. Long Polling • Many simultaneous pending connections means server CPU and memory might take a hit • As frequency becomes high, long polling becomes like polling, taking a considerable network hit on server
  • 25. Long Polling • Supported almost everywhere • Not that hard to implement • Solid, reliable choice for many applications
  • 27. Streaming • Client connects to server and stays connected for as long as it can • Server keeps feeding updates through the same connection as they become available
  • 28. Streaming • Many simultaneous pending connections means server CPU and memory might take a hit • Very efficient network-wise • Great for high-frequency (almost real-time) applications
  • 29. Streaming • Not supported by servers that can't flush output buffers • Nightmare to implement – Different browsers require various different hacks – IE requires altogether different "htmlfile" solution
  • 31. HTML5 Web Sockets • Browser can actually open and listen on ports, effectively trading the client/server role as it sees fit • Server can contact browser directly, precisely when necessary without extra overhead • Perfect for low-medium frequency applications – For real-time levels, streaming might still be the way to go
  • 32. HTML5 Web Sockets • Currently in "Working Draft" phase • Support remains extremely limited • Even when supported in all browsers, supporting legacy browsers will still be an issue Grid courtesy of http://caniuse.com/
  • 33. How I Think Frameworks Should Do It
  • 34. How I Think Frameworks Should Do It • No necessary server installation – Supporting servers optionally is nice • Support for all reasonably major browsers (e.g., IE6+) • Since different transport protocols are fit for different applications, they should all be supported – ContrastContrast: many tools today support only long polling
  • 35. How I Think Frameworks Should Do It • Hide / abstract away as much of the communication layer as possible – ContrastContrast: many tools are server-only or client-only. Developer must still be very aware of the extreme complexities of client/server interaction • Hide / abstract away as much of the data layer as possible – Developer merely indicates where the data is – Rely on framework to detect when data has changed – Event-driven: Have the framework invoke your callback – ContrastContrast: many tools require reuse of same data logic
  • 36. Comet Frameworks • XAJAX Comet plugin • phet • phpwebsocket • websocket.js • jQuery plugin • socket.io and node.js • jWebSocket • NOLOH
  • 38. How NOLOH Does It • Listener Control – Intended to listen to a source of data, and upon detecting changes, it triggers some defined method – A very unintimidating thing to throw into any application for developers of a very wide range of skill levels
  • 39. How NOLOH Does It • Source property – File, database query, web service, a method that returns data, or you can write your own • Update property (Event) – Gets triggered upon detecting changes • Transport property [optional] – Currently can be: Polling, Long Polling, or Streaming. Others are on the way
  • 41. Original Research • Similar to polling except server will not actually establish connection with browser when there are no updates • Server will protect itself from browser connections in the same way firewalls protect against denial-of-service attacks • When server has updates, then it will listen to browsers
  • 42. Original Research • Great for low-medium frequency applications –Especially in the absence of availability of web sockets • Still experimental, but early tests look promising
  • 44. • Check out NOLOH – http://www.noloh.com – Intro talk “High Performance WebApps Faster & Easier with NOLOH” tomorrow by Asher Snyder • Contact me at pross@noloh.com Thank You Presented by Philip Ross