In this article, I want to show readers this new proactive notification mechanism in SQL Server 2005 through a simple example of a Windows desktop form (based on the example database AdventureWorks SQL Server 2005). Because of the revolutionary changes in Visual Studio 2005, you can easily change this example to a Web application scenario.
First, the introduction
Developers tend to work caching strategy design when developing Web applications that are accessed by multiple people at the same time, not just in this type of program. This is because if data that is infrequently changed in such an environment is temporarily placed on an application server or on a user's machine, you can avoid frequent round-trip access to the database--and database access is costly. Previously, in a lower version of SQL Server (SQL Server 2000 and previous versions), when it was necessary to provide updates to others in the database, it was primarily through polling the database mechanism to provide constant query of the database Or it may be by means of a trigger stored in a database table or a Message Queuing method to achieve the purpose of the notification. Today, SQL Server 2005, one of the key components of Microsoft. NET 2.0 strategy, introduced the proactive notification (Query Notification) mechanism for the first time. SQL Server 2005 proactively notifies you when data changes are being used. This new design pattern will allow you to reduce the cost of network polling when the system data is not updated, which can greatly improve system performance.
In this article, I want to show readers this new proactive notification mechanism in SQL Server 2005 through a simple example of Windows desktop form (SQL Server 2005-based sample database AdventureWorks).
Because of the revolutionary changes in Visual Studio 2005, you can easily change this example to a Web application scenario.
Ii. active notifications in SQL Server 2005
Active notification (also known as "Query Notification") is a new effort developed by Microsoft Ado.net and SQL Server team. It allows you to buffer data and notify only when data in SQL Server changes, and once notified, you can refresh the buffer or take other necessary steps.