• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ajax and Comet: Implementing the Real-Time Web
 

Ajax and Comet: Implementing the Real-Time Web

on

  • 1,015 views

May 2008 - Alessandro Alinone's talk at Great Indian Developer Summit ...

May 2008 - Alessandro Alinone's talk at Great Indian Developer Summit

Video of the talk: http://www.youtube.com/watch?v=FsdWIN3YP7I

Ajax has proven a successful means to revamp the Web and facilitate the migration of many applications from "thick" clients to browser-based and zero-install clients. But several applications require real-time data to be effective (for example: financial market data visualization; online auctions; online gaming; messaging systems and social networks). The Comet paradigm, as an extension to the "traditional" Ajax techniques, allows any web page to receive real-time data pushed by a specialized server. This talk will introduce Comet from both a technical and historical perspectives. Several examples will be shown and a simple application, based on the Lightstreamer Comet framework, will be developed from scratch.

Statistics

Views

Total Views
1,015
Views on SlideShare
995
Embed Views
20

Actions

Likes
0
Downloads
6
Comments
0

4 Embeds 20

http://blog.lightstreamer.com 14
http://2020370271027153869_2c0b43eff025e2a9b2d21875b973a874520ebbfa.blogspot.com 3
http://www.linkedin.com 2
http://www.blogger.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ajax and Comet: Implementing the Real-Time Web Ajax and Comet: Implementing the Real-Time Web Presentation Transcript

    • 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.