Skip to contentManaged Kafka is live: Apache Kafka on AWS for half the cost of MSK

Microsoft SQL Server

Microsoft SQL Server source: choosing a replication method

Compare Artie's three ways to replicate Microsoft SQL Server (CDC capture instances, change tracking, and transaction log backups) by what they capture, latency, and load on the database.

Artie reads changes from SQL Server in one of three ways. Pick one per pipeline in Source > Replication method.

Compare the methods

Capture instancesChange trackingTransaction log backups
What Artie readsCDC change tables, through cdc.fn_cdc_get_all_changes_<capture_instance>CHANGETABLE(CHANGES …), joined to the table for the row’s current valuesLog backup files on an SMB share
SQL Server interfaceDocumented and supported by MicrosoftDocumented and supported by MicrosoftArtie parses the log backup files
Every change, including intermediate updatesYesNo. One change per primary key per poll, with the row’s values at read timeYes
Before values on updatesYesNoYes
Event timestampCommit timeTime Artie read the changeCommit time
LatencyPolls every 2.5 secondsPolls every 2.5 secondsYour log backup interval, plus a 5-minute poll
Load on the databaseCDC capture job and change tablesChange tracking side tablesLowest. Artie reads backup files, and queries the database only for metadata, off-row values, and updates to tables without supplemental logging.
Needs timestamp columnsNoNoNo
Needs a primary keyCaptured by the capture instanceYesYes

Compare the methods

Pick a method to see its column of the table.

Capture instancesDefaultReads SQL Server CDC change tables.

Every change, including intermediate updates

Yes

What Artie reads
CDC change tables, through cdc.fn_cdc_get_all_changes_<capture_instance>
SQL Server interface
Documented and supported by Microsoft
Before values on updates
Yes
Event timestamp
Commit time
Latency
Polls every 2.5 seconds
Load on the database
CDC capture job and change tables
Needs timestamp columns
No
Needs a primary key
Captured by the capture instance
Set up capture instances

Which method to use

  • Use capture instances when every change matters, for example financial or audit data. It captures each insert, update and delete with before and after values, through an interface Microsoft supports.
  • Use transaction log backups when you can’t add load to the production database. You already take log backups for recovery, and Artie reads those files. This method is in early access.
  • Use change tracking only when you can’t enable CDC. It tells Artie which rows changed, not how they changed. If a row is updated three times between polls, the destination gets only the last version.

All three methods deliver changes at least once and never skip a change because Artie restarted. See Delivery guarantees. For Always On availability groups, see High availability and failover.

Advanced

Single tenant databases

Artie can unify tables across multiple databases into a single destination table to support single tenant databases.

  1. Contact Artie to turn on database unification for your workspace.
  2. In the Databases tab, choose Unify across databases and select the databases to unify.
  3. In the Tables tab, turn on Unify across databases for each table to merge. This triggers a backfill.
  4. If your primary key isn’t unique across databases, add the full source table name (dbName.schemaName.tableName) to it. In the Destination tab’s Advanced settings, check Add ‘full source table name’ column, then Include ‘full source table name’ column as part of primary key.