What you are talking about is known as “Server Push” If you Google that, you’ll find some solutions, but I don’t think there are any good ones yet.
I looked at trying to do this 3 years ago. Sadly, I think there is no better solution today than then.
You are probably stuck with polling the server from a timer. That’s what I did.
The key is to make the poll very, very fast. The client side wants to say: Give me only new data since last time I asked. You want to be able to quickly determine with no more than a single hit on the database if anything has changed. “last time I asked” needs to be a timestamp or a sequence number on an *INDEXED* column, so that you can quickly determine if there is anything new.
You can get good response times this way, but scalability could be an issue. For large numbers of clients, you might need to look at a caching solution that eliminates the database round trip for every poll.
Someday there will be an elegant solution for this!!! (I hope).
Comments
Leave a comment Trackback