Example: Persisting to a Database
Step-by-step example of one-way data replication from GridGain to a MySQL relational database using the GridGain Source Connector and the Confluent JDBC Sink Connector.
The example demonstrates one-way GridGain-to-RDBMS data replication. GridGain Source Connector streams data from GridGain into Kafka with the data schema attached. JDBC Sink Connector streams the data from Kafka into relational tables using attached data schema.

Prerequisites
GridGain Enterprise or Ultimate version 8.8.31 or later is installed. The
IGNITE_HOMEenvironment variable points to GridGain installation directory on every GridGain node.Kafka 3.5.0 is installed. The
KAFKA_HOMEenvironment variable points to Kafka installation directory on every node.MySQL Server 8 is installed and running.
DBeaver is used as a database management tool.
Step 1: Install GridGain Source Connector
1.1. Prepare GridGain Connector Package
Download the gridgain/gridgain-kafka-connect component that matches your GridGain version from Confluent Hub, unzip it, and rename the extracted directory to gridgain-kafka-connect. If you run GridGain Ultimate Edition, copy $IGNITE_HOME/libs/gridgain-ultimate/*.jar into the gridgain-kafka-connect/lib directory.
1.2. Register GridGain Connector with Kafka
In this example we assume /opt/kafka/connect is the Kafka connectors installation directory.
For every Kafka Connect worker:
Copy the
gridgain-kafka-connectdirectory you prepared in the previous step to/opt/kafka/connecton the Kafka Connect worker.Edit Kafka Connect Worker configuration (
$KAFKA_HOME/config/connect-standalone.propertiesfor single-worker Kafka Connect cluster or$KAFKA_HOME/config/connect-distributed.propertiesfor multiple node Kafka Connect cluster) to register the connector on the plugin path:
Step 2: Install JDBC Sink Connector
Download Confluent JDBC Connector package.
Unzip the package and rename the extracted directory to
confluentinc-kafka-connect-jdbc.In this example we use MySQL Server 8 as the RDBMS. Download the MySQL Server JDBC Driver and copy the driver JAR into the
confluentinc-kafka-connect-jdbc/libdirectory.For every Kafka Connect worker:
Copy the JDBC Connector package directory
/opt/kafka/connectto the Kafka Connect worker.Edit Kafka Connect Worker configuration (
$KAFKA_HOME/config/connect-standalone.propertiesfor single-worker Kafka Connect cluster or$KAFKA_HOME/config/connect-distributed.propertiesfor multiple node Kafka Connect cluster) to register the connector on the plugin path:
Step 3: Configure and Start GridGain Cluster
In this example we will start only one GridGain server node.
Create the
ignite-server.xmlconfiguration file:Start GridGain node (the below command assumes you are in the directory where ignite-server.xml is located):
Step 4: Create GridGain Tables and Add Some Data
In GridGain Nebula, go to the Queries page, create a table called Person, and add some data to the table:
Step 5: Initialize MySQL Database
In DBeaver connect to MySQL as administrator and:
Create database gridgain-kafka-mysql
Create user demo with password demo
Grant the demo user full privileges to the gridgain-kafka-mysql database.

Step 6: Start Kafka Cluster
In this example we will start only one Kafka broker.
Start Zookeeper:
Start Kafka Broker:
Step 7: Configure and Start Kafka Connect Cluster
In this example we will start only one Kafka Connect worker.
7.1. Configure Kafka Connect Worker
In this example we need data schema attached to data so make sure you have the following properties in your Kafka Connect worker configuration ($KAFKA_HOME/config/connect-standalone.properties for single-worker Kafka Connect cluster or $KAFKA_HOME/config/connect-distributed.properties for multiple node Kafka Connect cluster):
7.2. Configure GridGain Source Connector
Create the kafka-connect-gridgain-source.properties configuration file (replace IGNITE_CONFIG_PATH with a path to your ignite-server.xml):
7.3. Configure JDBC Sink Connector
Create the kafka-connect-mysql-sink.properties configuration file:
7.4. Start Kafka Connect Worker
The following command assumes you are in the directory where the source and sink connector configurations are located:
Check the source and sink connectors status. If everything is OK, you will see each connector running two tasks. For example, if you have curl and jq available on a Kafka Connect worker, you can run:
Step 8: Observe Initial Data Load
In DBeaver, connect to the gridgain-kafka-mysql database and see the Sink Connector created table quickstart-SQL_PUBLIC_PERSON that already contains 2 entries:

Step 9: Observe Runtime Data Load
Add more person data to the source cluster. In GridGain Nebula, execute this query:
In DBeaver, get the latest quickstart-SQL_PUBLIC_PERSON table data and see the new entry appeared:

Step 10: Observe Dynamic Reconfiguration
Create a new table called City in the source cluster and load some data into it. In GridGain Nebula, execute the query:
In DBeaver, see the Sink Connector created the new quickstart-SQL_PUBLIC_CITY table containing the 2 entries:

This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

