Technical advice needed regarding polling the database

  • Thread starter Thread starter Nadia Amir
  • Start date Start date
N

Nadia Amir

I have a database which is very frequently updated .I want an option that
user can specify that after how many minutes he/she wants to see those
changes . Like a mechanism which would do



1.. Poll database after a user defined period and then bring those changes
,mean while displaying the stale data (like Cache )
2.. Also allow user to choose if he/she wants to see/notify updates as
they come
3.. Can notify change ( if any ) in a particular table occur


I have read a lot about SQLDependency class which is used to data caching
..The reason I am confused is



1. The recommendations are that don't use this feature if your data is
frequently updating (in my case data is frequently updating)

2. The class does Cache data for me but I cant find any mechanism which
would notify me that a change has occurred and how many row in a particular
table are added.



I am confused .What feature I should used . Should SQLDependency class can
do the things I want or these can be done without SQLDependency Cache
feature .



Please advice.



Thanks in advance
 
Is it safe to assume that the user is using one app to view the db while it
is a seperate mechanism or app that is updating the db?

One thing that my team has done is to install SQL Server Notification
Services, and configure it to send a notification to a central location if
the data has changed. Then, when an app starts, it can register itself with
the central location as "interested" in these events. The central store can
either send the events directly to the app, or more appropriately, it can
send the events to a cache management system that uses configuration data to
decide if it should update the cache right away or at a later date.

The user at the client end always asks the cache for data. The cache system
will go to the local db, and if the data is old, or if a message has come in
saying that the data is obsolete, then it can do one of two things: a) it
can return to the caller with obsolete data (and an indicator saying so) or
b) it can hold the caller thread and ask the source system for updated data.

This works for our systems. I hope this helps.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Back
Top