MySQL CDC

Use the MySQL CDC (Change Data Capture) Connector to get data from MySQL into Decodable. The MySQL CDC Connector is powered by Debezium and able to extract and send change events (INSERTS, UPDATES, and DELETES) through Decodable.

Overview

Connector name

mysql-cdc

Type

source

Delivery guarantee

exactly once

Prerequisites

Before you can get data from MySQL, the following requirements must be met:

  • Your MySQL database must be accessible from the Decodable network. Contact us for more information about enabling network access to your infrastructure.

  • Your MySQL instance must be configured to send change records. See Setting up MySQL from the Debezium documentation.

    • If you are using AWS RDS, Automated Backups must be enabled. Otherwise, binlog will be disabled regardless of any other settings. See How To: Set up a MySQL CDC connection on AWS RDS for detailed instructions on how to configure MySQL on AWS RDS.

  • Your MySQL user must have sufficient permissions for CDC replication.

Steps

Follow these steps to get data from MySQL into Decodable. These steps assume that you are using the Decodable web interface. However, if you want to use the Decodable CLI to create the connection, you can refer to the Property Name column for information about what the underlying property names are.

  1. From the Connections page, select MySQL CDC and complete the following fields.

    UI Field Property Name in the Decodable CLI Description

    Connection Type

    N/A

    Select Source to use this connector to get data into Decodable.

    Host

    hostname

    The hostname for your MySQL database. For example, mysql-server.

    Port

    port

    Optional. The port number to use when connecting to the host.

    Defaults to 3306.

    Database

    database-name

    The name of the database containing the table that you want to ingest data from.

    Table Name

    table-name

    The name of the table that you want to capture CDC records from.

    Username

    username

    The username to use to authenticate to MySQL.

    Password

    password

    The password associated with the username. This must be provided as a secret resource. If you are using the Decodable CLI, run decodable secret list to view available secrets or decodable secret --help for help with creating a new secret.

    Note: For security purposes, Decodable will never display secret values in plaintext. You can manage which users have permissions to create, delete, or modify secrets in the Access Control management view. See Roles, Groups, and Permissions for more information.

    Scan Startup Mode

    scan.startup.mode

    Optional. Specifies where in the collection to start reading data when the connection is first started or when it’s restarted. Must be one of the following:

    • initial: At startup, takes an initial snapshot of monitored database tables, then continuously reads the latest binlog entries thereafter.

    • latest-offset: Avoids taking an initial snapshot of monitored database tables upon startup. Instead, reads changes from the end of the binlog, capturing only the modifications made since the connector was initiated or restarted.

    • timestamp: Bypasses the snapshot phase and initiates reading binlog events directly from a specified timestamp.

    Defaults to initial.

    Starting Timestamp

    scan.startup.timestamp-millis

    The timestamp to start reading data from, specified in milliseconds since Epoch time.

    Only applicable if scan.startup.mode is timestamp.

  2. Select the stream that you’d like to connect to this connector. Then, select Next.

  3. Define the connection’s schema. Select New Schema to manually enter the fields and field types present or Import Schema if you want to paste the schema in the form of an Avro or JSON array.

    1. The stream’s schema must match the schema of the data that you plan on sending through this connection.

    2. You must designate one or more fields to use as a primary key. A primary key is a field that contains a value that can be used to uniquely identify each row in a table. To specify a primary key, you must first explicitly tell Decodable that the type is not null explicitly by entering: <type> NOT NULL. For example: BIGINT NOT NULL.

    3. For more information about Change Data Capture, change streams, or creating a stream, see the following pages:

  4. Select Next when you are finished providing defining the connection’s schema.

  5. Give the newly created connection a Name and Description and select Save.