问题
I am little confused in one of the design consideration. Following are my requirements:
My web-application need to retrieve real time data through database.
Every update in the data should be reflected back to user.
A session can last for couple of hours
Every user will have their personal data in the report (eg select * from user where User = ‘A1’;)
There can be around 300-400 users at a time
Data retrieval mechanism should be outside the main application (eg. Web services)
Database is shared between my app and other apps
- I am using C#.
Now the following are the options I was considering:
WCF web service: Every user will poll for the update for eg in every 5 sec make request to web service.
Query Notification using SqlDependency and SqlCacheDependency: where every change in database will be notified to my web service and then my web service will notify every user (PS: additional mechanism to send data from my web service to my web app) http://www.codeproject.com/Articles/144344/Query-Notification-using-SqlDependency-and-SqlCach#heading0010
Aim is to minimize the load on database as much as possible. I really like the approach 1 because of its simplicity but not sure polling for so many user for very long time will have any performance issue?
来源:https://stackoverflow.com/questions/21833741/design-consideration-for-data-retrieval-pooling-vs-sqldependency-and-sqlcached