server push and comet (rails user group hamburg 2009-06-10)
DESCRIPTION
This is the short talk I gave at the Rails usergroup Hamburg event on 2009-06-10.TRANSCRIPT
Server Pushor „How to initiate client side changes from the server
without polling every second or so“
Donnerstag, 11. Juni 2009
Websocket
Donnerstag, 11. Juni 2009
HTML5
Donnerstag, 11. Juni 2009
var myWebSocket = new("ws://www.websocket.org");myWebSocket.onmessage = function(evt)
{ alert( "Received Message: " + evt.data); };
Donnerstag, 11. Juni 2009
Can you use it?
Donnerstag, 11. Juni 2009
IE6 (released 2001) market share May 09:
~15%
Donnerstag, 11. Juni 2009
No!
Donnerstag, 11. Juni 2009
Then what?
Donnerstag, 11. Juni 2009
Juggernaut
Donnerstag, 11. Juni 2009
needs flash
Donnerstag, 11. Juni 2009
no thanks
Donnerstag, 11. Juni 2009
Comet
Donnerstag, 11. Juni 2009
general technique, no implementation
Donnerstag, 11. Juni 2009
longer connections
Donnerstag, 11. Juni 2009
server and client side components
Donnerstag, 11. Juni 2009
server side
Donnerstag, 11. Juni 2009
traditionally (think Apache):one thread per connection
Donnerstag, 11. Juni 2009
Comet serversreduce server-side resources per connection
• Reduce overhead per thread
• use event libraries
• use microthreads (e.g. Erlang)
Donnerstag, 11. Juni 2009
client side
Donnerstag, 11. Juni 2009
asynchronous request
Donnerstag, 11. Juni 2009
hold it!
Donnerstag, 11. Juni 2009
drop connection after receiving something useful
Donnerstag, 11. Juni 2009
then reinitiate connection
Donnerstag, 11. Juni 2009
still request/reponse
Donnerstag, 11. Juni 2009
BUT
data flow occurs on the server‘s schedule
close approximation of the server → client flow
Donnerstag, 11. Juni 2009
Implementations
Donnerstag, 11. Juni 2009
Bayeux
Donnerstag, 11. Juni 2009
standard protocol
Donnerstag, 11. Juni 2009
many servers use it
CometdErlyCometGlassFish
JettyOrbited
Persevere...
Donnerstag, 11. Juni 2009
many client libs use it
Dojo (inventor)jQueryGWT
...
Donnerstag, 11. Juni 2009
combine any server and js lib
Donnerstag, 11. Juni 2009
Jabber
Donnerstag, 11. Juni 2009
JS libs available
Donnerstag, 11. Juni 2009
mature Server
Donnerstag, 11. Juni 2009
scales
Donnerstag, 11. Juni 2009
can hold ten thousands connections on a single server
Donnerstag, 11. Juni 2009
proprietary solutions
Donnerstag, 11. Juni 2009
RMDS2Web Server
500.000 concurrent users on single Dell-server
"most scalable real-time push web system"
commercial
Donnerstag, 11. Juni 2009
APE (Ajax Push Engine)
"Real time data streaming"
open source client and serverproprietary protocol (NOT Bayeux)
Donnerstag, 11. Juni 2009
Who is doing it?
Donnerstag, 11. Juni 2009
FacebookMeebo (Chat)
...
Donnerstag, 11. Juni 2009
That is all!
Donnerstag, 11. Juni 2009
Reminder:
Rails-Konferenz call for papers deadline:
1st of July
Donnerstag, 11. Juni 2009