Work in Progress: This page is under development. Use the feedback button on the bottom right to help us improve it.

CDC (Change Data Capture)

Change Data Capture connector for streaming database changes in real-time. Captures INSERT, UPDATE, and DELETE operations from the database transaction log.

Supported Databases

DatabaseStatus
MySQLSupported

Quick Example

apiVersion: laminar.io/v1
kind: Profile
spec:
  name: mysql-cdc
  connector: cdc
  config:
    database_type: mysql
    hostname: localhost
    port: 3306
    username: replication_user
    password: your-password
    server_name: mysql-prod
 
---
apiVersion: laminar.io/v1
kind: Table
spec:
  name: orders_cdc
  connector: cdc
  connection_profile_id: mysql-cdc
  config:
    database_include_list: ecommerce
    table_include_list: ecommerce.orders
    snapshot_mode: initial
    offset_mode: earliest
  schema:
    format:
      json: {}
    fields:
      - field_name: id
        field_type:
          type:
            primitive: Int64
        nullable: false
      - field_name: customer_id
        field_type:
          type:
            primitive: Int64
        nullable: false
      - field_name: total
        field_type:
          type:
            primitive: F64
        nullable: false
      - field_name: status
        field_type:
          type:
            primitive: Utf8
        nullable: false

Configuration

Required

PropertyTypeDescription
database_typestringDatabase type (mysql)
hostnamestringDatabase server hostname or IP
usernamestringDatabase user with replication privileges
passwordstringPassword for the database user
server_namestringLogical server name for identification

Optional

PropertyTypeDefaultDescription
portnumber3306Database port

MySQL User Permissions

The database user needs replication privileges:

GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT
ON *.* TO 'replication_user'@'%';

JSON Schema Reference

Connection Profile Schema
{
  "type": "object",
  "properties": {
    "database_type": {"type": "string", "enum": ["mysql"]},
    "hostname": {"type": "string"},
    "port": {"type": "number", "default": 3306},
    "username": {"type": "string"},
    "password": {"type": "string"},
    "server_name": {"type": "string"}
  },
  "required": ["database_type", "hostname", "username", "password", "server_name"]
}
Connection Table Schema
{
  "type": "object",
  "properties": {
    "database_include_list": {"type": "string"},
    "table_include_list": {"type": "string"},
    "snapshot_mode": {"type": "string", "enum": ["initial", "schema_only"]},
    "offset_mode": {"type": "string", "enum": ["earliest"]}
  },
  "required": ["database_include_list", "table_include_list"]
}