(sorta) real-time updates, with Trinidad

The technology to ensure (sorta) real-time updates on your web app is called, COMET. This is a giant hack, basically. There are three common ways to actually implement it. Polling, Long Polling and Continuous connection, by using the forever frame pattern/trick. All of them of certain issues:

  • Polling: efficient for rarely changing items, but potentially long latency
  • Long Polling: Latency is the amount of time needed to make a new connection (see Jean-Francois Arcand’s blog).  But this is inefficient for extremely fast (multiple times a minute) event rates and  it means a heavy thread load on servers where each request is a thread, non NIO servers (see Jean-Francois Arcand’s blog)
  • Continuous connection (aka HTTP Streaming): Technical issues (including proxy problems). But this approach has the lowest latency. It also has some issues on none NIO servers, as long polling.

That said… So there are (some cases) where polling is OK…

The good news is, that Trinidad actually supports polling out of the box, by its poll component. Specify a certain ping interval, to ask the server for an update… but keep in mind, the more you ping the server, the worse the client and server performance.

At Oracle we support the continuous connection as well, as part of ADF Faces 11g (Rich Client Framework).

About these ads

Howdy!

Posted in apache, comet, javascript, jsf, myfaces, trinidad, web²

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 32 other followers

%d bloggers like this: