Download - Real time web applications
![Page 1: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/1.jpg)
Developing Real-Time and Asynchronous Web Applications
Jess ChadwickArchitect / RIA Specialist
weblogs.asp.net/[email protected]
![Page 2: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/2.jpg)
Gratuitous Plug$$$
Buy My Books! $
$$
Now with 100% more
Awesome!
Gluten Free!
![Page 3: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/3.jpg)
The Real-Time Web
• Information as it happens
• Always Connected
![Page 4: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/4.jpg)
Why Should I Care?
•User Interaction, aka “Social Networking”
•News
![Page 5: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/5.jpg)
Ok, you’ve sold me.
Let’s do it!
![Page 6: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/6.jpg)
![Page 7: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/7.jpg)
The Web Isn’t Real-Time!
![Page 8: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/8.jpg)
Real-Time Web
1,000’s of users connected at once
![Page 9: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/9.jpg)
The Traditional Web
One user at a time
![Page 10: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/10.jpg)
Real-Time Web Hacks
![Page 11: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/11.jpg)
Real-Time Web Hack #1:
Polling
![Page 12: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/13.jpg)
Real-Time Web Hack #2:
Long Polling
![Page 14: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/14.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/15.jpg)
Real-Time Web Hack #3:
Server-Sent Events
![Page 16: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/16.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/17.jpg)
Real-Time Web Hack #4:
Web Sockets
![Page 18: Real time web applications](https://reader035.vdocuments.mx/reader035/viewer/2022070320/5588f77ad8b42ab4418b46bc/html5/thumbnails/18.jpg)
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)