|
First, let's talk about the problem that Polling Duplex solves. Polling Duplex is a special WCF channel that is available only to Silverlight. When your Silverlight application needs data from the server, it needs it in one of two different ways:
The Polling Duplex channel is a solution to the push problem. It allows server-side code to "push" data down to the Silverlight application. Under the hood the channel is using "Comet"-style tricks keeping HTTP connections open in much the same way that the Gmail application is able to receive push notifications of new mail.
This is great and the programming model for communicating with the Polling Duplex channel is brain-dead simple. It does NOT get any easier to implement push data to a RIA - not in Flash, not in AIR, and certainly not in JavaFX. The problem is that this solution doesn't scale. On the server side, for each concurrently running Silverlight application (so probably one per concurrent user), there is a full live socket being consumed that will not be relinquished until the client disconnects/closes their browser.
Worse is that the Polling Duplex channel defaults to only allowing 10 concurrent connections. You can programmatically tweak that by configuring the throttling behavior (as shown in this blog post here ).Even if you do increase the amount of concurrent connections allowed, those concurrent connections are still going to beat the crap out of your servers and good luck getting that to work seamlessly in a cluster/farm scenario.
If you need more than a handful of concurrent users and you want to do it in a way that scales and doesn't abuse your servers, then I highly, highly recommend looking into some kind of messaging / open gateway server. The only one I've played with for more than a few minutes is Kaazing , but I have nothing but good things to say about it. It's based on HTML 5 Web Sockets so you will be in good shape for the future.
Web Sockets are freaking awesome but that's a topic for another post.
Bottom line here is that if you're looking at any of the Polling Duplex samples online like the "stock ticker" sample, don't be fooled. It looks easy, but especially in the financial industry, you need high concurrency, high speed, low latency - and you're not going to get that with the polling duplex channel. If there was one place where I see it fitting is in the creation of intranet applications internal to an organization with a limited number of concurrent users.
I'd be curious if you've run actual scalability tests using Silverlight and
the PDBE, and compared those results to the other solutions you've
mentioned. (It's on my list to do, but I haven't gotten to it yet.) From
what I understand about how Silverlight implements the PDBE, I *thought* it
was very similar to how HTML 5 web sockets (aka "comet") works, i.e., it's
basically the same as repeatedly requesting a web page that (almost) never
returns any data: you send the TCP handshake, and then wait and do nothing
until the timeout period expires, and then do it all over again. It seems
to me like this would have a slightly higher overhead than, say, standard
TCP sockets (since you have to periodically re-open the connection), but
not dramatically so.
"there is a full live socket being consumed"
yeah, i think iis 7 can keep loads of connections open simultaneously
without using a thread for each one
we have been using kaazing for a while now, and its great, solid solution,
and scales, I have used the Duplex Channel in the past, but since using
KaaZing, have found it wanting.
Bidirectional connections for event notifications/call-backs have been
available through ICE (http://zeroc.com) for a long time on a variety of
platforms, and for a shorter time even for Silverlight. And this technology
is not a hack like polling or Comet.
The server side out of the box implementation of the Silverlight polling
dulpex protocol indeed has scalability challanges. However, there is a way
to scale-out the protocol in a web farm scenario, which is described at htt
p://tomasz.janczuk.org/2009/09/scale-out-of-silverlight-http-polling.html.