When a connection is available between a client and server, the application will synchronize with a server, and changed data flows in both directions. In this type of application, a client application queries and updates a local store. The data in those stores can be updated and the changes must be synchronized back to the Database Engine.Ī good example of two-way synchronization application is an occasionally connected application. In this scenario, the data in an instance of the Database Engine is synchronized with one or more data stores. Two-way synchronization applications can also be built that use change tracking. There are no changes to pass back to the Database Engine. The application must be able to keep the cache up-to-date with any changes that have been made to the database tables. As shown in the following illustration, a caching application requires data to be stored in the Database Engine and to be cached in other data stores. One-way synchronization applications, such as a client or mid-tier caching application, can be built that use change tracking. Change tracking can be used as a foundation for both one-way and two-way synchronization applications. One-Way and Two-Way Synchronization ApplicationsĪpplications that have to synchronize data with an instance of the SQL Server Database Engine must be able to query for changes. For more information, see About Change Data Capture (SQL Server). If an application requires information about all the changes that were made and the intermediate values of the changed data, using change data capture, instead of change tracking, might be appropriate. The fact that a row has changed and information about the change must be available and recorded at the time that the change was made in the same transaction.The latest data can be obtained directly from the table that is being tracked. Only the fact that a row has changed is required, not how many times the row has changed or the values of any intermediate changes. Applications can use change tracking to answer the following questions about the changes that have been made to a user table: Creating these mechanisms usually involved a lot of work and frequently involved using a combination of triggers, timestamp columns, new tables to store tracking information, and custom cleanup processes.ĭifferent types of applications have different requirements for how much information they need about the changes. Typically, to enable applications to query for changes to data in a database and access information that is related to the changes, application developers had to implement custom change tracking mechanisms. Change tracking is a lightweight solution that provides an efficient change tracking mechanism for applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |