In a recent project I wanted to share data between different instance. I tried different things like getting data using a timer and reading throug a web service. It had some slowness and I research about this and found about the "Sql Dependency.
Sql dependency was introduced in sql 2005 to provide data flow between separate instances of an application. This is a query notification feature of the sql. This query notification feature lets to subscribe for a query such that when the result of that query changes it will notify to the subscriber. This notification is a message.
Sql Dependency is a special .Net Class which is under the System.Data. This allows you to subscribe for a event and later subscribe command get the notification from the sql server. This notification triggers for each and every insert and deletes and send the notification to the subscriber. So we can get the table changes instantly using this feature. This has some effect on the inser and update commands. But this is very handy and you don't need to poll the database every now and then to get updates.
Following link is one of the best links that I have found. It demonstrate all the little things related to this topic.
http://www.codeproject.com/Articles/144344/Query-Notification-using-SqlDependency-and-SqlCach
Sql Dependency is a special .Net Class which is under the System.Data. This allows you to subscribe for a event and later subscribe command get the notification from the sql server. This notification triggers for each and every insert and deletes and send the notification to the subscriber. So we can get the table changes instantly using this feature. This has some effect on the inser and update commands. But this is very handy and you don't need to poll the database every now and then to get updates.
Following link is one of the best links that I have found. It demonstrate all the little things related to this topic.
http://www.codeproject.com/Articles/144344/Query-Notification-using-SqlDependency-and-SqlCach
No comments:
Post a Comment