Presentation_VeturiSrikanth

Download Report

Transcript Presentation_VeturiSrikanth

Asynchronous
Communication in
Financial Web
Applications
Veturi Srikanth
1
Streaming Data on the Web




2
HTTP is a Stateless Request-Response
protocol.
A large number of existing Web Applications
are Transactional and/or based on RequestResponse paradigm.
Financial Web Applications are mostly
Event-driven.
However HTTP 1.1 supports keep-alive
mechanism to reuse the connection for
more than one request.
Push Technology



3
Push vs. Pull
 Request for data originates with the publisher, not
client.
 Pull can emulate Push by constant polling, but this
has performance implications.
HTTP Server Push
 Content type multipart/x-mixed-replace in Mozilla
interpreted as server push but is not supported by
Microsoft.
Server-Sent Events
 Part of WHATWG Web Applications 1.0 spec but is
supported by Opera only.
Historical Note: PointCast

PointCast and Push Technology




4
Proprietary but was supported by both
Netscape and Microsoft.
Used for displaying news and other
information on a screen-saver.
Excessive bandwidth use overburdened
corporate networks and was banned.
Eventually went bankrupt and was shutdown
in 2000.
Yahoo Widgets
5
Yahoo Widgets
Based on Yahoo! Widget Engine
(formerly Konfabulator.
 Developed using Javascript and XML.
 Supports XMLHttpRequest.
 But each Widget runs in its own
server process and cannot be
integrated with other applications…

6
Dynamic RSS
Dynamic RSS feeds are generated by
a script on the fly.
 Cache Last-Modified field and use
Conditional GET. Server sends a
response code of 304 (instead of the
usual 200) if the page hasn’t changed.
 Useful for large volume datasets.

7
Ajax with Polling
Client can poll the server periodically
and update only part of a web page.
 Increasing responsiveness decreases
throughput and increases bandwidth
usage.
 Suitable for applications with
predictable update cycles (e.g. Yahoo
Finance with 20-minute delayed
feeds.

8
Ajax Comet
Uses persistent HTTP connections.
 Can use either Streaming or Long
Polling.
 Streaming (most efficient) – browser
opens single persistent connection
and events are handled incrementally.
 Long Polling – Server closes
connection after sending each event
but client reopens it immediately.

9
Lightstreamer
10
Lightstreamer Architecture
11
Flash/ActionScript
XMLSocket allows clients to
communicate with a server via
sockets.
 ActionScript event handlers can
execute code asynchronously.
 XML object allows reading external
data via XML files – can be used to
update data on a chart in real-time.

12
Flash Live Chart
(FXStreet.com)
13
Summary
Several techniques, none ‘perfect’.
 For streaming quotes use Comet.
 For large data sets, use dynamic
RSS.
 For simple standalone widgets, Yahoo
Widgets are fine.
 HTML 5.0 is expected to support
server-side eventing.

14