SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Ajax and Comet:
Implementing the Real-Time Web
Alessandro Alinone
Great Indian Developer Summit
May 2008
Contents
•
•
•
•
•

Push Technology: some history
Web paradigms: from Ajax to Comet
Comet applications and examples
Hands-on code lab
Lightstreamer architecture
Push Technology
Some milestones
Technologies
1996

2000

Webcasting, narrowcasting
Applet-based push

2005

Ajax

2006

Comet

2008

Key Players
PointCast and 30+ more
Caplin and custom solutions
Lightstreamer
Pushlets
KnowNow
Gmail, Meebo, Renkoo, etc.
Cometd and other open source
Updated Caplin and others

Applet-free push

Real-Time Web
Sync & Async Modes
Synchronous mode
of a server (S)
with respect to an actor (A)
R1

Asynchronous mode
of a server (S)
with respect to an actor (A)
R1

wait...

R2

R2

wait...

actions by A
through time
(requests)

actions by S
through time
(responses)

actions by A
through time
(requests)

actions by S
through time
(responses)
Page Refresh
Typical issues:

refresh 1

✔

refresh 2

wait...

wait...

wait...

wait...

refresh 3

user

browser

server

High bandwidth usage

✔

wait...

Low update frequency;
no real time

✔

wait...

High load on Web server
Ajax Polling
Typical issues:
✔

wait...

High bandwidth usage (but
potentially lower than
model 1)

✔

wait...

Low update frequency;
no real time

✔

action 1

High load on Web server

Advantages:
action 2

user

✔

wait...

browser

server

User interface never
blocked
Comet Long Polling
Typical issues:
✔

wait...

Medium bandwidth usage
(HTTP headers present in
each round-trip cycle)

✔

wait...

Medium update frequency;
near real time

✔

action 1

High load on Web server

Advantages:
wait...

user

browser

✔

server

User interface never
blocked

✔

action 2

Zero latency on lowfrequency events
Comet Streaming
Typical issues:
✔

action 1

Blocked by some antivirus software mounted on
proxy servers

Advantages:
✔

✔

user

browser

server

Low bandwidth usage
(very little overhead)

✔

action 2

High update frequency;
true real time

Low load on the network
infrastructure
Real-Time Web Paradigms
Method of sending
data with respect to
the user’s actions

Method of sending
data with respect to
the browser’s actions

Synchronous

Synchronous

Classic Ajax Application
 Periodic Polling

Asynchronous

Synchronous

Comet Application (a)
 Long Polling - aka:
 Smart Polling
 Asynchronous Polling
 Ajax Push
 Reverse Ajax

Asynchronous

Partially
Asynchronous

Comet application (b)
 Comet Streaming - aka:
 Comet - Forever Frame
 Streaming Ajax

Asynchronous

Asynchronous

Application Paradigm
Traditional Web Application
 Page Refresh
Comet Applications
• Where to use Comet
– Finance: market data distribution (quotes, news,
orders, portfolios)
– Gaming and Betting
– Auctions
– Monitor Consoles
– Sports Results
– Social Networks (chat, messaging, presence)
– Transportation (timetables, traffic, etc.)
– Opinion Polls
– … and many more!
Comet Examples
• Demos:
– www.lightstreamer.com/demo

• Real-world applications:
– www.hedgestreet.com
– www.igmarkets.com.sg
– www.extrabet.com
– www.yoonew.com
Hands-on Code Lab
• Let’s develop a Comet application using
Lightstreamer: “Hello India” chat
– Spec: Push users’ messages messages to a
page displayed in any browsers
– Server-side code: will use Java
– Client-side code: will use JavaScript
[20-minute Lab…]
The Architecture
• Lightstreamer (www.lightstreamer.com) is a
comprehensive Comet framework made up of:
• A Comet Server
• Server-side SDKs for: Java, .NET, plain sockets
• Client-side SDKs for: JavaScript (AJAX), ActionScript (Flex),
Java SE, Java ME (midlets), .NET, plain HTTP clients
Advanced Features
• Data Filterability
– The nature of some data enables filterability.
– Lightstreamer’s data filtering always ensures consistency and
completeness.
– Different subscription modes are available, based on the data nature
(Merge, Distinct, Raw, Command --> metapush).

• Bandwidth Control
– A maximum bandwidth can be allocated for each user. Data is
dispatched based on the configured bandwidth.
– Bandwidth control is available in both streaming mode and smart-polling
mode.

• Frequency Control
– Each single subscription can request a maximum update frequency.
– Frequency control is available in both streaming mode and smart-polling
mode.
Advanced Features (cont’ed)
• Multi-Stage Filtering
– A Pre-Filter is available to preliminarily sample the data on a
global basis.

• Adaptive Streaming
– Lightstreamer automatically detects Internet congestions and
heuristically throttles the data flow based on the available
bandwidth.
– When the network channel is fully available again, the user will
not receive a burst of old updates but will start seeing fresh data
at once (i.e. data aging is avoided).
– Data is aggregated efficiently within TCP packets, with a direct
control over the number of sent packets (a trade-off between
latency and overhead reduction can be configured).
– Adaptive streaming is particularly useful for streaming sessions
held over mobile networks or any unreliable networks.

Weitere ähnliche Inhalte

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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?
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 

Empfohlen

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Ajax and Comet: Implementing the Real-Time Web

  • 1. Ajax and Comet: Implementing the Real-Time Web Alessandro Alinone Great Indian Developer Summit May 2008
  • 2. Contents • • • • • Push Technology: some history Web paradigms: from Ajax to Comet Comet applications and examples Hands-on code lab Lightstreamer architecture
  • 3. Push Technology Some milestones Technologies 1996 2000 Webcasting, narrowcasting Applet-based push 2005 Ajax 2006 Comet 2008 Key Players PointCast and 30+ more Caplin and custom solutions Lightstreamer Pushlets KnowNow Gmail, Meebo, Renkoo, etc. Cometd and other open source Updated Caplin and others Applet-free push Real-Time Web
  • 4. Sync & Async Modes Synchronous mode of a server (S) with respect to an actor (A) R1 Asynchronous mode of a server (S) with respect to an actor (A) R1 wait... R2 R2 wait... actions by A through time (requests) actions by S through time (responses) actions by A through time (requests) actions by S through time (responses)
  • 5. Page Refresh Typical issues: refresh 1 ✔ refresh 2 wait... wait... wait... wait... refresh 3 user browser server High bandwidth usage ✔ wait... Low update frequency; no real time ✔ wait... High load on Web server
  • 6. Ajax Polling Typical issues: ✔ wait... High bandwidth usage (but potentially lower than model 1) ✔ wait... Low update frequency; no real time ✔ action 1 High load on Web server Advantages: action 2 user ✔ wait... browser server User interface never blocked
  • 7. Comet Long Polling Typical issues: ✔ wait... Medium bandwidth usage (HTTP headers present in each round-trip cycle) ✔ wait... Medium update frequency; near real time ✔ action 1 High load on Web server Advantages: wait... user browser ✔ server User interface never blocked ✔ action 2 Zero latency on lowfrequency events
  • 8. Comet Streaming Typical issues: ✔ action 1 Blocked by some antivirus software mounted on proxy servers Advantages: ✔ ✔ user browser server Low bandwidth usage (very little overhead) ✔ action 2 High update frequency; true real time Low load on the network infrastructure
  • 9. Real-Time Web Paradigms Method of sending data with respect to the user’s actions Method of sending data with respect to the browser’s actions Synchronous Synchronous Classic Ajax Application  Periodic Polling Asynchronous Synchronous Comet Application (a)  Long Polling - aka:  Smart Polling  Asynchronous Polling  Ajax Push  Reverse Ajax Asynchronous Partially Asynchronous Comet application (b)  Comet Streaming - aka:  Comet - Forever Frame  Streaming Ajax Asynchronous Asynchronous Application Paradigm Traditional Web Application  Page Refresh
  • 10. Comet Applications • Where to use Comet – Finance: market data distribution (quotes, news, orders, portfolios) – Gaming and Betting – Auctions – Monitor Consoles – Sports Results – Social Networks (chat, messaging, presence) – Transportation (timetables, traffic, etc.) – Opinion Polls – … and many more!
  • 11. Comet Examples • Demos: – www.lightstreamer.com/demo • Real-world applications: – www.hedgestreet.com – www.igmarkets.com.sg – www.extrabet.com – www.yoonew.com
  • 12. Hands-on Code Lab • Let’s develop a Comet application using Lightstreamer: “Hello India” chat – Spec: Push users’ messages messages to a page displayed in any browsers – Server-side code: will use Java – Client-side code: will use JavaScript [20-minute Lab…]
  • 13. The Architecture • Lightstreamer (www.lightstreamer.com) is a comprehensive Comet framework made up of: • A Comet Server • Server-side SDKs for: Java, .NET, plain sockets • Client-side SDKs for: JavaScript (AJAX), ActionScript (Flex), Java SE, Java ME (midlets), .NET, plain HTTP clients
  • 14. Advanced Features • Data Filterability – The nature of some data enables filterability. – Lightstreamer’s data filtering always ensures consistency and completeness. – Different subscription modes are available, based on the data nature (Merge, Distinct, Raw, Command --> metapush). • Bandwidth Control – A maximum bandwidth can be allocated for each user. Data is dispatched based on the configured bandwidth. – Bandwidth control is available in both streaming mode and smart-polling mode. • Frequency Control – Each single subscription can request a maximum update frequency. – Frequency control is available in both streaming mode and smart-polling mode.
  • 15. Advanced Features (cont’ed) • Multi-Stage Filtering – A Pre-Filter is available to preliminarily sample the data on a global basis. • Adaptive Streaming – Lightstreamer automatically detects Internet congestions and heuristically throttles the data flow based on the available bandwidth. – When the network channel is fully available again, the user will not receive a burst of old updates but will start seeing fresh data at once (i.e. data aging is avoided). – Data is aggregated efficiently within TCP packets, with a direct control over the number of sent packets (a trade-off between latency and overhead reduction can be configured). – Adaptive streaming is particularly useful for streaming sessions held over mobile networks or any unreliable networks.