Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 2648 |  Welcome, Guest!   Register  Login
Home > Articles > Sql Server > Change Tracking (CT) vs. Change Data Capture (CDC) in SQL server 2008

Change Tracking (CT) vs. Change Data Capture (CDC) in SQL server 2008

1 vote(s)
Rating: 5 out of 5
Article posted by Vishvvas on 7/30/2012 | Views: 2191 | Category: Sql Server | Level: Intermediate | Points: 250 red flag

Advertisements

Advertisements
This article explores differences in the features (of SQL server 2008 and higher) of providing tracking and auditing abilities i.e. the change tracking (CT) and data capture (CDC) abilities.

Introduction

In the prior articles on www.dotnetfunda.com , we have explored CT i.e. change tracking in SQL server 2008 http://www.dotnetfunda.com/articles/article1931-ct-in-sql-server-2008-r2.aspx and CDC at http://www.dotnetfunda.com/articles/article1924-cdc-in-sql-server-2008-r2-part-i.aspx and http://www.dotnetfunda.com/articles/article1926-cdc-in-sql-server-2008-r2-part-ii.aspx.

We have seen practical example as well as intrinsic of CDC. With these features available, it is not easy to choose either of them.  At the first glance they don’t seem to be too different. There would be scenarios wherein there could be some overlap among the requirements or needs.

Essentially most of the system/ applications need tacking abilities with different complexity and priority. Many of the situation demands what changed and when. Also “who changed it” could be an important facet in secured system, applications especially in finance, banking domains.

Change Tracking and Change Data Capture are 2 new features in SQL server 2008 and higher, to address such needs and they offer betterment than the custom or adhoc solutions in terms of atomicity, configurability and flexibility.

Let’s try to deep dive in the differences of CT and CDC.

Objective

To learn about the difference in CT and CDC features of SQL server (version 2008 and higher) leading to choose either of them.


Using the code

Change tracking doesn’t capture the changes in the data but senses that what row/s have changed in a table and change data capture actually captures the changed data too and is evident from the name itself. Let’s run through the comparison points tabulated for quick glance.

 

Feature / Point

Change Tracking

Change Data Capture

DML Changes- latest changes in data

YES

YES

The data which has undergone changes i.e. historical data for all changes

NO

YES

How many times the data has changed

NO

YES

Whether the column data has changed?

YES

YES

Capturing mechanism

Synchronous

Asynchronous

Performance Overhead

Minimal even though part of DML operation

Minimal as reads the log and not part of DML operation

Data Storage Requirement

Low

Higher

Querying the tracked information

Little complex: Join the tracked and source table and query

Straightforward: Querying the tracked tables

Compatibility with ADO.NET Synch services

YES

NO

Configuration efforts

Low

Medium

Synchronization (like replication)

Can help to detect conflicts in case of two way synchronization

Lot of configuration need to be done to make it work in replication scenario

Clean-up mechanism

Can be turned off

Can’t be turned off


Summary and Conclusion

Definitely having 2 features to provide the tracking and auditing abilities is good scenario but it is not easy to choose one of them in practical scenario. In the scenario where historical data is important, CDC is way to go. This generally happens in enterprise application scenario and in case where on tracking information and the latest copy of data can do, CT is to go for. This is generally applicable in small systems, applications.

Of course, this can go beyond the boundaries of small or complex applications and actually depend upon the requirements.

So no clear-cut boundaries and area for employing these techniques but this comparison shall help to deduce which technique to settle for but one thing is sure that one won’t need cumbersome custom solutions to help tacking and auditing.

HAPPY PROGRAMMING!!!


Reference

http://msdn.microsoft.com/en-us/library/bb933875.aspx

http://msdn.microsoft.com/en-us/library/bb964713.aspx

http://msdn.microsoft.com/en-us/library/bb933874.aspx

Advertisements

If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

Experience:18 year(s)
Home page:http://www.dotnetfunda.com
Member since:Monday, May 30, 2011
Level:Bronze
Status: [Member]
Biography:Over 16 years of experience, worked across different technologies and programming languages like PB,VB, ASP. C++, C#, VB.NET
 Responses
Posted by: Ashuthinks | Posted on: 08 Aug 2012 07:06:06 AM | Points: 25

Something very new for me... great article :)





>> Write Response - Respond to this post and get points
Related Posts

storing a Default Value in a Table

In this tutorial, we will see as how to use Row_Number function with lots of practicals.

In this article we will learn Percentile_Count Function of SQL Server 2012 (Denali)

A Database is a software system that defines a collection of predefined operations. Mainly it includes following operations 1.Efficient management of large amount of persistent data in a persistent storage (database) 2.Transaction Management which includes Concurrency Control, Atomicity and backup recovery procedure 3.A DataModel which gives a separate level of abstraction

Here I am going to share how can we take the database backup of all the SQL Server databases at once instead of taking it individually.

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/20/2013 8:35:54 AM