Skip to main content
The MSSQL Source Connector is a powerful and efficient solution designed to facilitate seamless data integration between your Microsoft SQL Server (MSSQL) databases and Popsink. This connector helps you synchronize with Microsoft SQL Server in real-time, ensuring that your target systems remain updated with the latest information in real-time, driving business intelligence, analytics, and operational efficiency.

Table of Contents

  1. Key Features
  2. Security
  3. Prerequisites
  4. Configuration
  5. Creating a Dedicated Role
  6. Enabling CDC
  7. Housekeeping Scripts

Key Features

  • Real-time Change Data Capture (CDC): the MSSQL Source Connector employs a CDC mechanism using the native Microsoft SQL Server logical decoding feature, capturing and streaming changes (inserts, updates, and deletes) as they occur in your database.
  • Fault-tolerant and Scalable: The MSSQL Source Connector is built with fault tolerance and scalability in mind. It is capable of resuming data replication from the last known offset in case of failures, ensuring data consistency and minimal downtime.
  • Initial Load: The connector automatically performs an initial full table load.
  • Advanced Filtering: The MSSQL Source Connector provides a range of filtering options, including table and schema filters, allowing you to selectively replicate specific tables and schemas based on your needs.

Security

The connector supports SSL/TLS encryption for secure communication between the connector and your Microsoft SQL Server database.

Prerequisites

Relevant Roles

  • sysadmin: role required for enabling CDC at the database level.
  • db_owner: role required for enabling CDC at the table level.

Configuration

Advanced Options

Connecting through an SSH Tunnel

If the database is only reachable through a bastion host, enable SSH Tunnel and provide:

Table Selection

After a successful credential check, pick the tables to replicate from the discovered list. The selection is stored as a comma-separated whitelist in schema.table format.

Creating a Dedicated Role

This step creates a dedicated replication ROLE, assigns it to your USER and grants it the necessary permissions to work with

Steps

  1. Create the Replication Role:
  2. Assign the Replication Role to a User:
  3. Grant CDC Permissions:
  4. Grant Permissions to Check Version, Encryption, and Track Schema:

Enabling CDC

To enable CDC for your data, you need to do two things: 1) Enable CDC at the Database level, and 2) Enable CDC at the Table level.

For Databases

  1. Enable CDC on a Database:
  2. Enable CDC on Multiple Databases:

For Tables

  1. Enable CDC on a Table:
  2. Enable CDC on multiple Tables:

For All

  1. Enable CDC on multiple Tables in multiple Databases:

Housekeeping Scripts

Here are a few useful scripts that can help you manage the CDC lifecycle.

Purging Logs

Enabling Logs can take up space on your database so it’s best practice to purge them regularly. There is a tradeoff between the log retention and the operational resilience of your replication pipeline. A longer retention means you will need more time to recover from outages before having to resync. Shorter retention takes up less space but gives you less time to recover.
  1. Purge CDC Logs:

Check if CDC is Enabled

  1. Check if it is Enabled on a Database:
    0 means CDC is not enabled, 1 means it is.
  2. Check if it is Enabled on a Table:
    0 means CDC is not enabled, 1 means it is.

Disable CDC

  1. Disable CDC on a Database:
  2. Disable CDC on a Table: