0

I suppose I'm looking for a best practice, but I've read conflicting information on the various ways to do this. I'm attempting to put together an example of a webpage that contains a grid of information that shows exactly what is in the database. The table could be updated from the webpage via a form, but it could also be updated from various other sources.

How can I go about alerting users to the updates? Here's what I've gone through so far:

  1. SignalR could be used to let users "subscribe" to updates on the grid. This would work for the insert/update from the form to the database to alert users. But what about the actual data coming from other non-.NET sources

  2. OracleDependency: Callback hits .NET when the DB is updated. I've read this is not good to use on a table that is updated constantly. Why is that? Is this a viable option to hook into SignalR and alert users in the group?

  3. Basic polling: Am I overthinking this? Should I simply poll the database on each client, get the changes, and insert into the table via AJAX?

John Saunders
  • 157,405
  • 24
  • 229
  • 388
jlrolin
  • 1,532
  • 8
  • 36
  • 66
  • fwiw - i'd rewind the question a little and ask what is it that you're actually trying to achieve by displaying the records at table level?? in my opinion, when looking for best practice you may find that it's not a recommended practice to track changes it db level inside a grid as the context of the change may be pretty transparent and of no real value when viewing the table (i'm thinking of FK's etc). just my devils advocate thinking :) – jim tollan Jan 15 '13 at 09:46

1 Answers1

0

I would go for a "longrunning"-controller polling the datasource. This way you will only have ONE point polling the datasource... Then when data is changed you can tell the clients subscribing.

I'm not sure that signalR has longrunning controllers, but you can probably figure it out. Or use XSockets.NET that has support for this..

I strongly recommend to not poll from each client regardless of what you choose.

Regards Uffe

Uffe
  • 2,255
  • 1
  • 11
  • 9