Real time web applications

18
Developing Real-Time and Asynchronous Web Applications Jess Chadwick Architect / RIA Specialist weblogs.asp.net/ jesschadwick [email protected]

Transcript of Real time web applications

Page 1: Real time web applications

Developing Real-Time and Asynchronous Web Applications

Jess ChadwickArchitect / RIA Specialist

weblogs.asp.net/[email protected]

Page 2: Real time web applications

Gratuitous Plug$$$

Buy My Books! $

$$

Now with 100% more

Awesome!

Gluten Free!

Page 3: Real time web applications

The Real-Time Web

• Information as it happens

• Always Connected

Page 4: Real time web applications

Why Should I Care?

•User Interaction, aka “Social Networking”

•News

Page 5: Real time web applications

Ok, you’ve sold me.

Let’s do it!

Page 6: Real time web applications
Page 7: Real time web applications

The Web Isn’t Real-Time!

Page 8: Real time web applications

Real-Time Web

1,000’s of users connected at once

Page 9: Real time web applications

The Traditional Web

One user at a time

Page 10: Real time web applications

Real-Time Web Hacks

Page 11: Real time web applications

Real-Time Web Hack #1:

Polling

Page 12: Real time web applications

PollingBenefits Drawbacks

• Takes advantage of how the web really works

• Reliable

• Universal browser support

• Wasteful – requests occur regardless of data

• Drains server and network resources

• Doesn’t scale

Page 13: Real time web applications

Real-Time Web Hack #2:

Long Polling

Page 14: Real time web applications

Long PollingBenefits Drawbacks

• Uses “standard web techniques”

• Less wasteful – fewer requests than “regular” polling

• Universal browser support

• Less reliable – frequent broken connections

• Based on request-response interaction (might be some delay between requests)

Page 15: Real time web applications

Real-Time Web Hack #3:

Server-Sent Events

Page 16: Real time web applications

Server-Sent EventsBenefits Drawbacks

• True real-time

• Rich JavaScript API

• Universal browser support…

except

• Less reliable (broken connections)

• One-way communication (client server)

Page 17: Real time web applications

Real-Time Web Hack #4:

Web Sockets

Page 18: Real time web applications

WebSocketsBenefits Drawbacks

• True real-time

• True bi-directional communication

• Rich JavaScript API

• Good browser support…

except and Opera

• Emerging standard

• Doesn’t use “standard web techniques”

• Less reliable (broken connections)