<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Nadia</title>
    <description>The latest articles on DEV Community by Daniel Nadia (@danielnadia).</description>
    <link>https://dev.to/danielnadia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4251408%2F3c69a06d-a4c1-4be9-9400-bed1a53951f3.png</url>
      <title>DEV Community: Daniel Nadia</title>
      <link>https://dev.to/danielnadia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danielnadia"/>
    <language>en</language>
    <item>
      <title>MySQL CDC PostgreSQL with Apache SeaTunnel 3.1.0: A Reproducible Walkthrough</title>
      <dc:creator>Daniel Nadia</dc:creator>
      <pubDate>Fri, 20 Nov 2026 14:22:15 +0000</pubDate>
      <link>https://dev.to/danielnadia/mysql-cdc-postgresql-with-apache-seatunnel-310-a-reproducible-walkthrough-1ik0</link>
      <guid>https://dev.to/danielnadia/mysql-cdc-postgresql-with-apache-seatunnel-310-a-reproducible-walkthrough-1ik0</guid>
      <description>&lt;p&gt;A replication job can report &lt;code&gt;RUNNING&lt;/code&gt; while the row you care about is still missing from the target. For an engineer operating a CDC pipeline, the useful questions are concrete: Did the initial data arrive? Did an update change the existing row? Did a delete disappear downstream? Can the job resume and process a new change after a savepoint?&lt;/p&gt;

&lt;p&gt;This walkthrough answers those questions with a small, inspectable &lt;strong&gt;MySQL CDC → PostgreSQL&lt;/strong&gt; pipeline. It is based on a real run of the official Apache SeaTunnel &lt;strong&gt;3.1.0&lt;/strong&gt; distribution, with source statements and target queries captured at each stage. The exercise covers the initial snapshot, inserts, updates, deletes, one add-column schema change, and controlled savepoint stop-and-restore.&lt;/p&gt;

&lt;p&gt;Apache SeaTunnel is an &lt;strong&gt;open-source data integration tool&lt;/strong&gt;. Here, its MySQL CDC connector reads the source, the SeaTunnel engine executes the pipeline, and the JDBC sink writes to PostgreSQL. There is no intermediate transform, Kafka cluster, or custom transfer application in this example.&lt;/p&gt;

&lt;p&gt;The commands below are deliberately plain: native SeaTunnel shell scripts, the MySQL client, and &lt;code&gt;psql&lt;/code&gt;. The setup is included in the article, so the walkthrough does not depend on a video or an external helper download.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was actually tested
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MySQL 8.0.46                 SeaTunnel 3.1.0                   PostgreSQL 16.6
integration.customers  →  MySQL-CDC → Zeta → JDBC  →  integration.public.customers
                          one engine node
                          parallelism = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Tested choice&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SeaTunnel binary and CDC/JDBC connector artifacts&lt;/td&gt;
&lt;td&gt;3.1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Java runtime&lt;/td&gt;
&lt;td&gt;Java 11.0.33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL image&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mysql:8.0.46&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL image&lt;/td&gt;
&lt;td&gt;&lt;code&gt;postgres:16.6-alpine&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL JDBC driver&lt;/td&gt;
&lt;td&gt;8.4.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL JDBC driver&lt;/td&gt;
&lt;td&gt;42.7.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Job mode&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;STREAMING&lt;/code&gt;, asynchronous cluster submission&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Source table&lt;/td&gt;
&lt;td&gt;MySQL database &lt;code&gt;integration&lt;/code&gt;, table &lt;code&gt;customers&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Target table&lt;/td&gt;
&lt;td&gt;PostgreSQL database &lt;code&gt;integration&lt;/code&gt;, schema &lt;code&gt;public&lt;/code&gt;, table &lt;code&gt;customers&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The release archive was checked against Apache's SHA512, and the starter JAR reported &lt;code&gt;version=3.1.0&lt;/code&gt;. The final run completed all 16 verification steps. Its evidence is functional correctness for these test cases, not a throughput benchmark, a high-availability test, or proof of end-to-end exactly-once delivery. In particular, the configuration below explicitly sets &lt;code&gt;exactly_once = false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The Java image tag can advance. Check the runtime version in your own run; pin an image digest when you need immutable infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prepare a disposable environment
&lt;/h2&gt;

&lt;p&gt;The official 3.1.0 deployment prerequisite is &lt;strong&gt;Java 11 or 17 with &lt;code&gt;JAVA_HOME&lt;/code&gt; set&lt;/strong&gt;. Docker is only the isolation mechanism used here, not a SeaTunnel requirement. No Python runtime is needed for this workflow. See the &lt;a href="https://seatunnel.apache.org/docs/3.1.0/getting-started/locally/deployment/" rel="noopener noreferrer"&gt;versioned deployment guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For this Docker-based route, use Bash on macOS or Linux, a running Docker engine, and &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;tar&lt;/code&gt;, &lt;code&gt;unzip&lt;/code&gt;, &lt;code&gt;shasum&lt;/code&gt;, &lt;code&gt;sed&lt;/code&gt;, and &lt;code&gt;openssl&lt;/code&gt;. Allow several gigabytes of free space. The Java runtime comes from the engine container, so a host JDK is unnecessary for this route.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use a new directory and disposable database instances.&lt;/strong&gt; The commands create and modify test rows, including a delete and an ALTER TABLE. Do not point the configuration at a production database. No database port is published to the host.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir seatunnel-cdc-lab
&lt;span class="nb"&gt;cd&lt;/span&gt; seatunnel-cdc-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lab uses root/postgres accounts for convenience. That is not the recommended production access model.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Define the complete job
&lt;/h2&gt;

&lt;p&gt;Create the template below. The quoted heredoc preserves &lt;code&gt;${table_name}&lt;/code&gt; literally; it is a SeaTunnel table mapping, not a shell variable to expand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; customers.conf.template &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'CONF'&lt;/span&gt;
env &lt;span class="o"&gt;{&lt;/span&gt;
  job.mode &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"STREAMING"&lt;/span&gt;
  job.name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"customers-cdc"&lt;/span&gt;
  parallelism &lt;span class="o"&gt;=&lt;/span&gt; 1
  checkpoint.interval &lt;span class="o"&gt;=&lt;/span&gt; 10000
  checkpoint.timeout &lt;span class="o"&gt;=&lt;/span&gt; 60000
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  MySQL-CDC &lt;span class="o"&gt;{&lt;/span&gt;
    base-url &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"jdbc:mysql://st310-tutorial-mysql:3306/integration"&lt;/span&gt;
    username &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"root"&lt;/span&gt;
    password &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;MYSQL_PASSWORD&amp;gt;"&lt;/span&gt;
    table-names &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"integration.customers"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    server-id &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"6530-6533"&lt;/span&gt;
    startup.mode &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"initial"&lt;/span&gt;
    schema-changes.enabled &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    exactly_once &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
sink &lt;span class="o"&gt;{&lt;/span&gt;
  jdbc &lt;span class="o"&gt;{&lt;/span&gt;
    url &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"jdbc:postgresql://st310-tutorial-pg:5432/integration"&lt;/span&gt;
    driver &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"org.postgresql.Driver"&lt;/span&gt;
    user &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"postgres"&lt;/span&gt;
    password &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;POSTGRES_PASSWORD&amp;gt;"&lt;/span&gt;
    generate_sink_sql &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    database &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"integration"&lt;/span&gt;
    table &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"public.${table_name}"&lt;/span&gt;
    schema_save_mode &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CREATE_SCHEMA_WHEN_NOT_EXIST"&lt;/span&gt;
    data_save_mode &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"APPEND_DATA"&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
CONF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few choices are important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;startup.mode = "initial"&lt;/code&gt; loads the existing table, then continues with binlog changes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;integration.customers&lt;/code&gt; is selected explicitly. The primary key will give the target a stable row identity for the update and delete checks.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;server-id = "6530-6533"&lt;/code&gt; is the CDC reader range for this lab. It must not collide with another replication client.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;schema-changes.enabled = true&lt;/code&gt; enables the later schema-change exercise. The test below establishes ADD COLUMN behavior only.&lt;/li&gt;
&lt;li&gt;The environment's checkpoint values are in &lt;strong&gt;milliseconds&lt;/strong&gt;: 10,000 for the interval and 60,000 for the timeout. These are lab settings, not a latency SLA or production tuning recommendation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://seatunnel.apache.org/docs/3.1.0/connectors/source/MySQL-CDC/" rel="noopener noreferrer"&gt;MySQL CDC reference for 3.1.0&lt;/a&gt; is the reference for source prerequisites and options.&lt;/p&gt;

&lt;p&gt;On the sink side, &lt;code&gt;generate_sink_sql = true&lt;/code&gt; uses the upstream schema and row operation to generate writes. &lt;code&gt;APPEND_DATA&lt;/code&gt; is a save-mode setting; it does not turn every CDC update into an extra inserted row. This run verifies that distinction with queries. The configured table mapping resolves to &lt;code&gt;public.customers&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The template retains the tested &lt;code&gt;user&lt;/code&gt; field for the JDBC sink; it may produce a deprecation warning recommending &lt;code&gt;username&lt;/code&gt;. Review the &lt;a href="https://seatunnel.apache.org/docs/3.1.0/connectors/sink/Jdbc/" rel="noopener noreferrer"&gt;3.1.0 JDBC sink reference&lt;/a&gt; before changing a working configuration. For Zeta, driver JARs belong in the engine's &lt;code&gt;lib/&lt;/code&gt; on every node and must be available when the processes start.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Keep passwords out of database-client command lines
&lt;/h2&gt;

&lt;p&gt;The following setup script downloads the release and matching connectors, checks the archive, generates random credentials, and starts the three isolated containers. It is a lab convenience script, not an Apache-provided installer. Its engine entry point is the native &lt;code&gt;bin/seatunnel-cluster.sh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The MySQL CLI gets its password from a private option file. This keeps credentials out of the SQL command line. Both that file and the runnable SeaTunnel job configuration contain secrets: do not print, commit, or distribute them. This local setup is not a secret-management system: privileged Docker or host users can inspect container environment variables, and the setup expands credentials while generating the configuration. Use managed secret delivery for production.&lt;/p&gt;

&lt;p&gt;The script refuses to reuse existing container names or a pre-existing lab network. If those resources already exist, inspect them rather than deleting them automatically. On a machine where this tutorial has already been run, use a separate environment or consistently change the lab names, network, and configuration hostnames.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; setup.sh &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'BASH'&lt;/span&gt;
&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail
&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"$(dirname "&lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;")"&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; docker curl tar shasum openssl unzip sed&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nb"&gt;command&lt;/span&gt; -v &lt;span class="s2"&gt;"$command"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Missing prerequisite: $command"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;2&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; name &lt;span class="k"&gt;in&lt;/span&gt; st310-tutorial-engine st310-tutorial-mysql st310-tutorial-pg&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
 &lt;span class="k"&gt;if&lt;/span&gt; docker container inspect &lt;span class="s2"&gt;"$name"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Refusing to reuse existing container: $name"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;2&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; docker network inspect st310-tutorial-net &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Refusing to reuse existing tutorial network'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;2&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -e .env &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -e runtime &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Use a fresh directory; .env/runtime already exists'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;2&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -n &lt;span class="s2"&gt;"${LAB_SUBNET:-}"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
 docker network create --subnet &lt;span class="s2"&gt;"$LAB_SUBNET"&lt;/span&gt; st310-tutorial-net
&lt;span class="k"&gt;else&lt;/span&gt;
 docker network create st310-tutorial-net
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="nb"&gt;umask&lt;/span&gt; 077
mkdir runtime
&lt;span class="nv"&gt;BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://downloads.apache.org/seatunnel/3.1.0
curl -fL --retry 3 &lt;span class="s2"&gt;"$BASE/apache-seatunnel-3.1.0-bin.tar.gz"&lt;/span&gt; -o runtime/apache-seatunnel-3.1.0-bin.tar.gz
curl -fL --retry 3 &lt;span class="s2"&gt;"$BASE/apache-seatunnel-3.1.0-bin.tar.gz.sha512"&lt;/span&gt; -o runtime/apache-seatunnel-3.1.0-bin.tar.gz.sha512
&lt;span class="o"&gt;(&lt;/span&gt;
 &lt;span class="nb"&gt;cd&lt;/span&gt; runtime
 shasum -a 512 -c apache-seatunnel-3.1.0-bin.tar.gz.sha512
 &lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s  %s\n'&lt;/span&gt; \
  &lt;span class="s1"&gt;'ca855b7934c375146cdaec9ff0f86e030350210b1391c4fbebea10d472008046b4ca7d05bc4decd5fd2e5f8e57bcde22de79f26ad21bf2d00efbc018c5b613d8'&lt;/span&gt; \
  &lt;span class="s1"&gt;'apache-seatunnel-3.1.0-bin.tar.gz'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; shasum -a 512 -c -
&lt;span class="o"&gt;)&lt;/span&gt;
tar -xzf runtime/apache-seatunnel-3.1.0-bin.tar.gz -C runtime
&lt;span class="nv"&gt;ST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$PWD/runtime/apache-seatunnel-3.1.0"&lt;/span&gt;
&lt;span class="nv"&gt;MAVEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://repo.maven.apache.org/maven2
&lt;span class="k"&gt;for&lt;/span&gt; artifact &lt;span class="k"&gt;in&lt;/span&gt; connector-cdc-mysql connector-jdbc&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
 curl -fL --retry 3 &lt;span class="s2"&gt;"$MAVEN/org/apache/seatunnel/$artifact/3.1.0/$artifact-3.1.0.jar"&lt;/span&gt; -o &lt;span class="s2"&gt;"$ST/connectors/$artifact-3.1.0.jar"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
curl -fL --retry 3 &lt;span class="s2"&gt;"$MAVEN/com/mysql/mysql-connector-j/8.4.0/mysql-connector-j-8.4.0.jar"&lt;/span&gt; -o &lt;span class="s2"&gt;"$ST/lib/mysql-connector-j-8.4.0.jar"&lt;/span&gt;
curl -fL --retry 3 &lt;span class="s2"&gt;"$MAVEN/org/postgresql/postgresql/42.7.8/postgresql-42.7.8.jar"&lt;/span&gt; -o &lt;span class="s2"&gt;"$ST/lib/postgresql-42.7.8.jar"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(openssl rand -hex 24)"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(openssl rand -hex 24)"&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'MYSQL_ROOT_PASSWORD=%s\nPOSTGRES_PASSWORD=%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"$MYSQL_ROOT_PASSWORD"&lt;/span&gt; &lt;span class="s2"&gt;"$POSTGRES_PASSWORD"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .env
&lt;span class="c"&gt;# Passwords are random hexadecimal strings, so they contain no sed/HOCON metacharacters.&lt;/span&gt;
sed -e &lt;span class="s2"&gt;"s/&amp;lt;MYSQL_PASSWORD&amp;gt;/$MYSQL_ROOT_PASSWORD/g"&lt;/span&gt; \
    -e &lt;span class="s2"&gt;"s/&amp;lt;POSTGRES_PASSWORD&amp;gt;/$POSTGRES_PASSWORD/g"&lt;/span&gt; \
    customers.conf.template &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; runtime/customers.conf
chmod 600 runtime/customers.conf
&lt;span class="c"&gt;# Private native MySQL client option file. Never print or distribute it.&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'[client]\nuser=root\npassword=%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"$MYSQL_ROOT_PASSWORD"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; runtime/mysql-client.cnf
chmod 600 runtime/mysql-client.cnf
docker run -d --name st310-tutorial-mysql --network st310-tutorial-net \
 -v &lt;span class="s2"&gt;"$PWD/runtime/mysql-client.cnf:/tmp/tutorial-client.cnf:ro"&lt;/span&gt; \
 -e MYSQL_ROOT_PASSWORD -e &lt;span class="nv"&gt;MYSQL_DATABASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;integration mysql:8.0.46 \
 --server-id=3101 --log-bin=mysql-bin --binlog-format=ROW --binlog-row-image=FULL \
 --gtid-mode=ON --enforce-gtid-consistency=ON
docker run -d --name st310-tutorial-pg --network st310-tutorial-net \
 -e POSTGRES_PASSWORD -e &lt;span class="nv"&gt;POSTGRES_DB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;integration postgres:16.6-alpine
docker run -d --name st310-tutorial-engine --network st310-tutorial-net \
 -v &lt;span class="s2"&gt;"$ST:/opt/seatunnel"&lt;/span&gt; -v &lt;span class="s2"&gt;"$PWD/runtime/customers.conf:/opt/seatunnel/config/customers.conf:ro"&lt;/span&gt; \
 -w /opt/seatunnel eclipse-temurin:11-jdk bash bin/seatunnel-cluster.sh
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'\nContainers started. Continue with section 4 of this walkthrough after the databases are ready.\n'&lt;/span&gt;
BASH
bash setup.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the supplied checksum check. If the release has moved off the downloads mirror, use the corresponding &lt;code&gt;https://archive.apache.org/dist/seatunnel/3.1.0/&lt;/code&gt; location and still verify the archive. A failed download or checksum is a stop condition, not a reason to skip validation.&lt;/p&gt;

&lt;p&gt;If Docker has exhausted its predefined address pools, inspect the existing networks and host routes. Choose an unused private CIDR and use &lt;code&gt;LAB_SUBNET=YOUR_UNUSED_CIDR bash setup.sh&lt;/code&gt; in a fresh setup. Do not run a global prune to make room. A partially completed setup is not safe to rerun blindly: inspect the resources it created and resume the appropriate command.&lt;/p&gt;

&lt;p&gt;Wait for database initialization before continuing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker logs --tail 30 st310-tutorial-mysql
docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg pg_isready -U postgres -d integration
docker logs --tail 30 st310-tutorial-engine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MySQL should report ready for connections; PostgreSQL should accept connections. Engine startup alone does not mean a job has been submitted.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Check versions and the MySQL binlog
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine printenv JAVA_HOME
docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine java -version
unzip -p runtime/apache-seatunnel-3.1.0/starter/seatunnel-starter.jar   META-INF/maven/org.apache.seatunnel/seatunnel-starter/pom.properties

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-mysql mysql   --defaults-extra-file=/tmp/tutorial-client.cnf --table integration   -e &lt;span class="s2"&gt;"SELECT VERSION(); SHOW VARIABLES WHERE Variable_name IN ('log_bin','binlog_format','binlog_row_image','gtid_mode');"&lt;/span&gt;

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s1"&gt;'SHOW server_version;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check &lt;code&gt;version=3.1.0&lt;/code&gt; in the JAR metadata. The tested MySQL result was:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;log_bin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ON&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;binlog_format&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ROW&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;binlog_row_image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FULL&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gtid_mode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ON&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This lab deliberately enables GTID. Do not infer that GTID is mandatory for every MySQL 8 deployment. For an existing database, check the &lt;a href="https://seatunnel.apache.org/docs/3.1.0/connectors/source/MySQL-CDC/" rel="noopener noreferrer"&gt;connector's version-specific preparation guidance&lt;/a&gt; and coordinate any global changes with its administrator. The CDC account also needs the appropriate snapshot and replication privileges; using root here avoids turning this small exercise into an account-provisioning tutorial.&lt;/p&gt;

&lt;p&gt;Notice that &lt;code&gt;--defaults-extra-file&lt;/code&gt; is the first option after &lt;code&gt;mysql&lt;/code&gt;. There is no nested &lt;code&gt;sh -c&lt;/code&gt; and no password on the command line.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Create a source table with a stable key
&lt;/h2&gt;

&lt;p&gt;Run this once in the fresh &lt;code&gt;integration&lt;/code&gt; database. A table-exists error means you should inspect your environment, not drop a table automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; -i st310-tutorial-mysql mysql   --defaults-extra-file=/tmp/tutorial-client.cnf --table integration &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'SQL'&lt;/span&gt;
CREATE TABLE customers &lt;span class="o"&gt;(&lt;/span&gt;
  id BIGINT PRIMARY KEY,
  name VARCHAR&lt;span class="o"&gt;(&lt;/span&gt;100&lt;span class="o"&gt;)&lt;/span&gt; NOT NULL,
  city VARCHAR&lt;span class="o"&gt;(&lt;/span&gt;100&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
INSERT INTO customers VALUES
  &lt;span class="o"&gt;(&lt;/span&gt;101, &lt;span class="s1"&gt;'Alice'&lt;/span&gt;, &lt;span class="s1"&gt;'Seattle'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
  &lt;span class="o"&gt;(&lt;/span&gt;102, &lt;span class="s1"&gt;'Bob'&lt;/span&gt;, &lt;span class="s1"&gt;'Toronto'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
SELECT * &lt;span class="k"&gt;FROM&lt;/span&gt; customers ORDER BY id&lt;span class="o"&gt;;&lt;/span&gt;
SQL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected source rows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;id&lt;/th&gt;
&lt;th&gt;name&lt;/th&gt;
&lt;th&gt;city&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;td&gt;Alice&lt;/td&gt;
&lt;td&gt;Seattle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;td&gt;Bob&lt;/td&gt;
&lt;td&gt;Toronto&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We will use these exact keys to distinguish row updates from accidental duplicate inserts and to verify deletion. No target table is created manually in this example; the configured sink creates it.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Submit the job, then verify the initial snapshot
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine bash bin/seatunnel.sh   -c config/customers.conf -m cluster --async -n customers-cdc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the numeric ID from the actual &lt;code&gt;Submit job finished&lt;/code&gt; response. The job name is a readable label; the job ID is what subsequent lifecycle commands use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;JOB_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;REPLACE_WITH_YOUR_NUMERIC_JOB_ID

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine bash bin/seatunnel.sh   -j &lt;span class="s2"&gt;"$JOB_ID"&lt;/span&gt; -m cluster

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s1"&gt;'SELECT * FROM public.customers ORDER BY id;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait until PostgreSQL contains the same two rows as MySQL. If the target table is not visible yet, initialization may still be in progress. Check the job and engine logs, then query again. Treat persistent errors as errors rather than polling indefinitely.&lt;/p&gt;

&lt;p&gt;The acceptance condition is the target data, not just a successful asynchronous submission. Keep the streaming job running throughout the next four checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Verify INSERT, UPDATE, and DELETE separately
&lt;/h2&gt;

&lt;p&gt;Run each mutation once and check both databases before proceeding. Repeating an INSERT with the same primary key will fail at the source; that is not a CDC recovery test.&lt;/p&gt;

&lt;h3&gt;
  
  
  INSERT: a new row after the snapshot
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-mysql mysql   --defaults-extra-file=/tmp/tutorial-client.cnf --table integration   -e &lt;span class="s2"&gt;"INSERT INTO customers VALUES (103, 'Carol', 'Austin'); SELECT * FROM customers ORDER BY id;"&lt;/span&gt;

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s1"&gt;'SELECT * FROM public.customers ORDER BY id;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The target should now contain Alice, Bob, and Carol. Because the existing job remained running, this check exercises a change following the initial snapshot.&lt;/p&gt;

&lt;h3&gt;
  
  
  UPDATE: keep the key, change the value
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-mysql mysql   --defaults-extra-file=/tmp/tutorial-client.cnf --table integration   -e &lt;span class="s2"&gt;"UPDATE customers SET city='Vancouver' WHERE id=102; SELECT * FROM customers ORDER BY id;"&lt;/span&gt;

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s1"&gt;'SELECT * FROM public.customers ORDER BY id;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expect one row with ID 102, now in Vancouver. The condition is precise: Bob's existing key must carry the new value, rather than producing a second customer row.&lt;/p&gt;

&lt;h3&gt;
  
  
  DELETE: remove the disposable test row
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-mysql mysql   --defaults-extra-file=/tmp/tutorial-client.cnf --table integration   -e &lt;span class="s1"&gt;'DELETE FROM customers WHERE id=101; SELECT * FROM customers ORDER BY id;'&lt;/span&gt;

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s1"&gt;'SELECT * FROM public.customers ORDER BY id;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alice should disappear from both results. Bob and Carol should remain. On a slower machine, query the target again after a short wait; do not assume zero synchronization delay from the edited demonstration.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Test one schema change explicitly
&lt;/h2&gt;

&lt;p&gt;Add &lt;code&gt;email&lt;/code&gt;, then update Carol's value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; -i st310-tutorial-mysql mysql   --defaults-extra-file=/tmp/tutorial-client.cnf --table integration &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'SQL'&lt;/span&gt;
ALTER TABLE customers &lt;span class="k"&gt;ADD&lt;/span&gt; email VARCHAR&lt;span class="o"&gt;(&lt;/span&gt;255&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
UPDATE customers SET &lt;span class="nv"&gt;email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'carol@example.test'&lt;/span&gt; WHERE &lt;span class="nv"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;103&lt;span class="o"&gt;;&lt;/span&gt;
SELECT * &lt;span class="k"&gt;FROM&lt;/span&gt; customers ORDER BY id&lt;span class="o"&gt;;&lt;/span&gt;
SQL

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s1"&gt;'SELECT * FROM public.customers ORDER BY id;'&lt;/span&gt;

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s2"&gt;"SELECT column_name, data_type FROM information_schema.columns WHERE table_schema='public' AND table_name='customers' ORDER BY ordinal_position;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify both the target structure and data: &lt;code&gt;email&lt;/code&gt; exists, Carol has &lt;code&gt;carol@example.test&lt;/code&gt;, and Bob's value is NULL. &lt;code&gt;psql&lt;/code&gt; displays NULL as an empty field by default; an empty display is not evidence that an empty string was written.&lt;/p&gt;

&lt;p&gt;This establishes the tested ADD COLUMN case. A column rename, drop, type conversion, incompatible default, or a different source/sink pair needs its own validation. Do not use one successful DDL test as a blanket schema-evolution guarantee.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Stop with a savepoint and restore by job ID
&lt;/h2&gt;

&lt;p&gt;First confirm the target has converged. Then request a savepoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine bash bin/seatunnel.sh   -s &lt;span class="s2"&gt;"$JOB_ID"&lt;/span&gt; -m cluster

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine bash bin/seatunnel.sh   -j &lt;span class="s2"&gt;"$JOB_ID"&lt;/span&gt; -m cluster
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this tested flow, the savepoint request completed and the job stopped. Check the command result and resulting job state before restoring. Keep the engine container and its checkpoint files intact.&lt;/p&gt;

&lt;p&gt;The lab uses the package's file-backed checkpoint location inside the engine container, &lt;code&gt;/tmp/seatunnel/checkpoint_snapshot&lt;/code&gt;. Container removal would discard that local state. This is deliberately a controlled job stop-and-resume exercise, not proof of recovery after losing the engine host or its storage.&lt;/p&gt;

&lt;p&gt;Restore with the same configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine bash bin/seatunnel.sh   -c config/customers.conf -r &lt;span class="s2"&gt;"$JOB_ID"&lt;/span&gt; -m cluster --async   -n customers-cdc-restored
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;-r&lt;/code&gt; takes the &lt;strong&gt;historical numeric job ID&lt;/strong&gt;, not a checkpoint file path. The verified run retained the same ID. Read your submission response and query the returned ID rather than assuming a new identifier was allocated.&lt;/p&gt;

&lt;p&gt;A restore response is still only an intermediate check. Write a new row after the restored job is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-engine bash bin/seatunnel.sh   -j &lt;span class="s2"&gt;"$JOB_ID"&lt;/span&gt; -m cluster

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-mysql mysql   --defaults-extra-file=/tmp/tutorial-client.cnf --table integration   -e &lt;span class="s2"&gt;"INSERT INTO customers VALUES (104, 'Dana', 'Boston', 'dana@example.test'); SELECT * FROM customers ORDER BY id;"&lt;/span&gt;

docker &lt;span class="nb"&gt;exec&lt;/span&gt; st310-tutorial-pg psql -U postgres -d integration   -c &lt;span class="s1"&gt;'SELECT * FROM public.customers ORDER BY id;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final PostgreSQL result observed in the real run was:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;id&lt;/th&gt;
&lt;th&gt;name&lt;/th&gt;
&lt;th&gt;city&lt;/th&gt;
&lt;th&gt;email&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;td&gt;Bob&lt;/td&gt;
&lt;td&gt;Vancouver&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;103&lt;/td&gt;
&lt;td&gt;Carol&lt;/td&gt;
&lt;td&gt;Austin&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:carol@example.test"&gt;carol@example.test&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;104&lt;/td&gt;
&lt;td&gt;Dana&lt;/td&gt;
&lt;td&gt;Boston&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:dana@example.test"&gt;dana@example.test&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The job status was &lt;code&gt;RUNNING&lt;/code&gt;, with &lt;code&gt;errorMessage&lt;/code&gt; null. The combination of that status and Dana's new target row provides evidence that this pipeline resumed processing. Alice remained deleted, and the preceding update and schema change remained visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting by the failed checkpoint in the walkthrough
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Observation&lt;/th&gt;
&lt;th&gt;Start here&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The engine will not start&lt;/td&gt;
&lt;td&gt;Check Java/JAVA_HOME, the mounted release directory, and &lt;code&gt;docker logs st310-tutorial-engine&lt;/code&gt;. A missing startup script is a filesystem/setup failure, not a connector failure.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL connection refused&lt;/td&gt;
&lt;td&gt;Wait for initialization; check the database container and the shared network. Docker-only hostnames will not resolve in an unrelated host process.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL access denied&lt;/td&gt;
&lt;td&gt;Check the private option file and its mount, then the source credentials in the job config. These are separate consumers of credentials. Do not debug by publishing passwords.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Driver class not found&lt;/td&gt;
&lt;td&gt;Verify the matching JDBC driver JARs are in the Zeta runtime's &lt;code&gt;lib/&lt;/code&gt; before startup. Restart only the affected engine after correcting its classpath.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Submission succeeds but rows do not arrive&lt;/td&gt;
&lt;td&gt;Query job status, examine the engine error, verify the selected source table, binlog settings, source privileges, and target permissions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Updates/deletes do not produce the expected target state&lt;/td&gt;
&lt;td&gt;Check stable row identity, source and target schemas, the selected JDBC write mode, and the actual row at each endpoint.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADD COLUMN does not converge&lt;/td&gt;
&lt;td&gt;Check source schema-change settings, target ALTER permissions, and errors for that exact DDL. Avoid testing another mutation until the failure is understood.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restore cannot find usable state&lt;/td&gt;
&lt;td&gt;Verify the historical job ID and that checkpoint storage still exists and is reachable. Do not remove the engine container while testing this local-state recovery path.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Names, network, or directory already exist&lt;/td&gt;
&lt;td&gt;Inspect the previous lab first. The setup intentionally refuses to overwrite it. Do not delete unrelated Docker resources.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 10-second checkpoint interval does not imply a 10-second replication delay. For performance work, measure the source commit, source position progression, pipeline processing, and target visibility separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before moving this pattern into production
&lt;/h2&gt;

&lt;p&gt;Use the walkthrough as a functional acceptance checklist, then extend it for the environment you actually operate:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Permissions and secrets.&lt;/strong&gt; Replace root/postgres with dedicated least-privilege accounts. Validate snapshot, binlog, target DML, and required DDL privileges. Add TLS and a deliberate credential-rotation process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State durability and retention.&lt;/strong&gt; Choose checkpoint storage that survives the failures you intend to tolerate. Align MySQL binlog retention with the longest credible outage and recovery window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delivery semantics.&lt;/strong&gt; Define the contract for retries, duplicate events, source positions, and sink commits. This configuration does not establish end-to-end exactly-once behavior; checkpointing alone is insufficient evidence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema and type coverage.&lt;/strong&gt; Test the actual DDL and types your application uses, including precision, timestamps/time zones, NULL behavior, and key changes. This article exercises a deliberately small schema.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failure coverage.&lt;/strong&gt; Test process crashes, network interruptions, database restarts, checkpoint failures, and recovery from durable state. A one-node cluster and a controlled savepoint restore do not prove high availability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capacity and observability.&lt;/strong&gt; Measure snapshot load, incremental lag, source and sink throughput, checkpoint duration/failures, resource use, and target correctness under realistic traffic. Increase parallelism based on evidence, not on this lab's value of one.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a non-Docker deployment, install Java 11 or 17, use the same official package and connector/driver layout, and replace Docker DNS names with addresses reachable from the engine. Start &lt;code&gt;bash bin/seatunnel-cluster.sh&lt;/code&gt;, then run the same &lt;code&gt;bin/seatunnel.sh&lt;/code&gt; job commands from a second terminal. The integration design does not depend on containerization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop the lab without deleting its evidence
&lt;/h2&gt;

&lt;p&gt;Once the final checks are complete, stop only the three containers created for this lab:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker stop st310-tutorial-engine st310-tutorial-mysql st310-tutorial-pg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This stops the processes without removing the containers. Keep the working directory, database volumes, and engine checkpoint state if you need to inspect or resume the experiment. Removing containers, volumes, or the working directory is a separate destructive operation; no global cleanup command is needed here.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to take away
&lt;/h2&gt;

&lt;p&gt;The practical value of this exercise is a repeatable verification loop: change one thing in MySQL, inspect PostgreSQL, and make the expected result explicit. Run that loop for the initial snapshot, each mutation type, the schema changes you rely on, and a new change after recovery.&lt;/p&gt;

&lt;p&gt;For this SeaTunnel 3.1.0 configuration, the final result is concrete: Bob was updated, Alice was deleted, Carol's new column was populated, and Dana arrived after savepoint restoration. That is a useful baseline for a more demanding production test plan.&lt;/p&gt;

&lt;h3&gt;
  
  
  Version-pinned references
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://seatunnel.apache.org/docs/3.1.0/getting-started/locally/deployment/" rel="noopener noreferrer"&gt;Apache SeaTunnel 3.1.0 deployment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://seatunnel.apache.org/docs/3.1.0/connectors/source/MySQL-CDC/" rel="noopener noreferrer"&gt;Apache SeaTunnel 3.1.0 MySQL CDC source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://seatunnel.apache.org/docs/3.1.0/connectors/sink/Jdbc/" rel="noopener noreferrer"&gt;Apache SeaTunnel 3.1.0 JDBC sink&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Video walkthrough:&lt;/strong&gt; &lt;a href="https://danielnadia.substack.com/p/mysql-cdc-to-postgresql-with-apache" rel="noopener noreferrer"&gt;Watch the 9:43 hands-on demo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>data</category>
      <category>database</category>
      <category>postgres</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
