Skip to main content
Debezium is a self-hosted distributed platform that can read data from a variety of sources and import it into Kafka. You can use Debezium to migrate data to CockroachDB from another database that is accessible over the public internet. As of this writing, Debezium supports the following database sources:
  • MongoDB
  • MySQL
  • PostgreSQL
  • SQL Server
  • Oracle
  • Db2
  • Cassandra
  • Vitess (incubating)
  • Spanner (incubating)
  • JDBC (incubating)
Migrating with Debezium requires familiarity with Kafka. Refer to the Debezium documentation for information on how Debezium is deployed with Kafka Connect.

Before you begin

Complete the following items before using Debezium:
  • Configure a secure CockroachDB cluster running the latest v24.1 with at least one , make a note of the credentials for the SQL user.
  • Install and configure Debezium, Kafka Connect, and Kafka.

Migrate data to CockroachDB

Once all of the prerequisite steps are completed, you can use Debezium to migrate data to CockroachDB.
  1. To write data from Kafka to CockroachDB, use the Confluent JDBC Sink Connector. First use the following dockerfile to create a custom image with the JDBC driver:
  2. Create the JSON configuration file that you will use to add data from your source database to a Kafka topic. For example:
  3. Create the JSON configuration file that you will use to create the sink. For example:
    Specify connection.url in . For information about where to find the CockroachDB connection parameters, see . The preceding snippet is an example configuration. For details on the configurable fields, see the Confluent JDBC Sink Connector documentation.
  4. To create the sink, POST the JSON configuration file to the Kafka Connect /connectors endpoint. Refer to the Kafka Connect API documentation for more information.

See also