Skip to main content
Transaction log backups are in early access. Contact Artie to enable Transaction log backups for your account.
With this method, Artie reads changes from your transaction log backup (.trn) files as they land in a shared folder, instead of from the live database. It adds the least load to your database. Latency depends on how often you take log backups.

What you’ll need

  • SQL Server 2019 and later
  • Database recovery model set to FULL or BULK_LOGGED
  • Log backups taken on a schedule to a folder on an SMB share Artie can reach, such as Amazon FSx for Windows File Server. See Backup folder and file names.
  • A primary key on each replicated table
  • Supplemental logging on each replicated table
  • A service account with SELECT on the database, for table metadata and off-row values

Setup

1

Configure log backups

Write every log backup for the database to one folder, with file names that end in _YYYYMMDD_HHMMSS.trn. For example, Ola Hallengren’s maintenance solution writes names in this format.
Use backup compression only with the MS_XPRESS (default) or ZSTD algorithm.
2

Enable supplemental logging

Follow Supplemental logging for each replicated table.
3

Add the SMB share in Artie

In Settings > Connectors, add an SMB share connector:
  • UNC path: the folder your log backups go to, the same path as in BACKUP LOG ... TO DISK. For example, \\fs-0123456789abcdef0.corp.example.com\share\sqlbackups.
  • Username and Password: a user that can read the folder, as DOMAIN\user or user@domain.
  • PrivateLink connection (optional): pick one if the share is only reachable privately. It must forward port 445.
4

Enter the connection in Artie

In Source, enter the database connection. Under Replication method, select Transaction log backups. Under Where are the transaction log backups stored?, pick the share from the previous step in the SMB share list.

Supplemental logging

By default, SQL Server logs only the bytes an UPDATE changed. For those tables, Artie looks the row up in the database when it reads the backup, so the message carries the row as it is at that point rather than as of the update. An update to a row that has since been deleted is lost. With supplemental logging, SQL Server logs the whole row for every update, and Artie reads updates straight from the backup. Enable it on each table in one of two ways:
To check, is_replicated should be 1 for each table:
When the pipeline starts, Artie logs each configured table that doesn’t have supplemental logging.

Letting the log truncate

Both options mark every transaction on these tables for replication. SQL Server keeps each one in the log until something marks it as distributed. Without the CDC capture job or a Log Reader Agent, log_reuse_wait_desc in sys.databases stays at REPLICATION, and the log keeps growing, even with regular log backups. Artie reads your log backups, so it’s safe to mark everything as distributed on a schedule. Each log backup still contains every change. Schedule this with SQL Server Agent:
Only run sp_repldone if nothing else reads these transactions: no CDC capture job, and no Log Reader Agent for another publication on the database.
Every 5 minutes, Artie checks whether the log is waiting on REPLICATION. It logs a warning once a database has been waiting for over an hour.

Backup folder and file names

Artie lists one folder, without subfolders, and reads files whose names end in _YYYYMMDD_HHMMSS.trn. It reads them in file name order and skips any file whose name sorts before the last file it read.
  • Use one folder per database, and one naming prefix. If backups land in subfolders, or different servers write different prefixes, Artie can skip files.
  • Keep every log backup in the folder until Artie has read it. Artie doesn’t check that each backup starts where the previous one ended.
A log backup that is missing, moved, or renamed before Artie reads it isn’t detected, and its changes aren’t replicated. Backfill the affected tables if this happens.
Artie treats a file as complete once its size is the same in two checks 3 seconds apart, and the writer has closed it. For availability groups, see Log backups in an availability group.

Advanced

  • Every 5 minutes, Artie looks for new backup files in the folder.
  • Artie parses each file’s backup container and log records, and builds row changes from the log records of the configured tables.
  • Artie publishes only committed transactions, in commit order. It drops rolled-back transactions.
  • A transaction that spans several log backups is held until it ends. Once its changes pass a few MB, Artie writes them to a spool directory on disk. If open transactions need more than 10 GiB of spool, the pipeline stops with transactions open across log backups need more than trnCdcSettings.spoolMaxBytes. End the transaction, or contact Artie to raise the limit.
  • Artie saves its position (the last file and the commit LSN) only after changes are written to its Kafka buffer. After a restart, it rereads from the first file with a still-open transaction and skips changes it has already published.
SQL Server doesn’t publish its log backup format. Artie checks each change against the table’s layout and stops instead of guessing. The pipeline stops with:
Nothing from that change on is published until it’s resolved. Contact Artie with the error. Resolving it usually means a backfill of the named table.Changes Artie stops on include an update logged without its whole row on a table with supplemental logging, an update whose row doesn’t match the table’s columns, and an update to an off-row value.
Values stored off-row, such as large VARCHAR(MAX) values, aren’t in the log with the rest of the row.
  • Inserts: Artie reads off-row values from the database. If the row has been deleted by then, they’re published empty.
  • Updates that leave an off-row value unchanged: the value stays as it is in the destination.
  • Updates that change an off-row value: the pipeline stops with update_off_row_value_changed. Backfill the table, or exclude the column.

Limitations

  • Encrypted databases and backups: TDE-encrypted databases and encrypted backups aren’t supported.
  • Backup compression: QAT_DEFLATE isn’t supported. Use MS_XPRESS or ZSTD.
  • Backup location: only SMB shares are supported. Azure Blob Storage isn’t supported yet.
  • Accelerated database recovery and heap tables with row versioning: updates aren’t certified. Contact Artie before using them.
  • TRUNCATE TABLE isn’t allowed on tables tracked by CDC or published for replication.
  • Latency is at least your log backup interval. Take log backups every few minutes for lower latency.