By Daniel Nadia · Apache SeaTunnel Contributor
Meet SeaTunnel: efficient integration across data sources, built for reliable ongoing synchronization
Apache SeaTunnel is an open-source distributed data integration tool for batch data movement and continuous synchronization. It connects databases, messaging systems, and analytical storage so that operational data can reach reporting systems, data warehouses, and other downstream applications without a separate custom synchronization program for every pair of systems.
Engineering teams usually ask three questions when choosing a synchronization tool: Can it move data efficiently? Can it connect to our existing systems? Can a long-running job recover from failures? These are useful ways to understand SeaTunnel's value:
- Efficient synchronization without repeatedly copying the entire table. With MySQL CDC, for example, SeaTunnel can split a snapshot into chunks for parallel reads. In the incremental phase, it captures changes from the binlog instead of repeatedly scanning the full table. This puts historical initialization and ongoing updates in the same pipeline. Actual throughput still depends on the source database, destination, data distribution, and parallelism settings. MySQL CDC 3.0.0
- A broad connector ecosystem that reduces repetitive integration work. SeaTunnel 3.0.0's project overview lists more than 160 connectors and covers batch, real-time, and CDC scenarios. Teams can organize reads, field processing, and writes around a common Source, Transform, and Sink model instead of maintaining unrelated scripts for different systems. Evaluate connector coverage and engine support for the combination you intend to use. Apache SeaTunnel website
- Recoverable state for reliable operation. SeaTunnel's built-in Zeta engine uses checkpoints to save job state for failure recovery; savepoints support planned stops and subsequent recovery. A continuously running pipeline can therefore recover from saved processing progress rather than defaulting to a complete reload. End-to-end consistency also depends on the source, sink connector, and commit protocol. Enabling checkpoints alone does not establish exactly-once semantics for every destination. Zeta 3.0.0 state storage and recovery
Together, these capabilities serve a practical goal: moving data efficiently across systems while maintaining the state the business expects through ongoing changes and recovery. Delete propagation is one concrete way to examine that goal.
This article addresses a scenario that can affect reporting correctness: when SeaTunnel synchronizes orders into PostgreSQL, why might an order remain in the destination after it has been deleted from the source? We will follow the released JDBC sink implementation in SeaTunnel 3.0.0 to explain how deletion events become database operations and which settings to check.
1. Define what the destination table represents
Suppose the reporting database in PostgreSQL contains a current-state table:
CREATE TABLE public.orders_current (
order_id BIGINT PRIMARY KEY,
status VARCHAR(32) NOT NULL
);It stores the latest state of each order. For a stable, unchanging key, order_id = 42, the synchronization contract should be explicit:
| Source operation | Expected destination state after the operation is applied |
|---|---|
Insert order 42 with status created | Order 42 exists with status created |
Update order 42 to paid | Order 42 exists with status paid |
| Delete order 42 | Order 42 no longer exists |
For an audit table, retaining an event that says “order 42 was deleted” may be exactly the right behavior. Before troubleshooting, distinguish a current-state replica from a complete change history. This article uses the former contract.
2. Capture, transport, execution, and visibility are separate stages
Change data capture, or CDC, identifies changes in the source database. After the source captures a DELETE, several steps remain before reporting queries see the change:
The source database deletes an order
→ The Source emits a delete event and the order identifier
→ The Transform preserves the operation semantics and the correct key
→ The JDBC Sink selects the delete execution path
→ The destination database successfully applies and commits the operation
→ Queries read the updated destination tableA running job and a captured source deletion are therefore insufficient evidence that the destination is correct. Follow a specific order key through the pipeline instead of relying only on job status or aggregate throughput.
Start with the key. If a transformation drops order_id, or renames it without updating the destination configuration, the sink cannot locate the intended row. If the actual unique identifier is (tenant_id, order_id), configuring only order_id does not express the same delete predicate.
For this example, the intended destination operation is:
DELETE FROM public.orders_current WHERE order_id = ?;The parameter must contain the key of the deleted order.
3. How SeaTunnel routes change events to the right SQL executor
SeaTunnel's JDBC sink supports more than one write path. Understanding which path is selected is more useful than simply checking that the job “uses JDBC.”
In version 3.0.0, JdbcOutputFormatBuilder considers COPY, custom SQL, and primary-key configuration when selecting an executor. In the ordinary keyed path used here, with COPY disabled and no custom SQL, the builder creates separate upsert and delete executors. The database dialect and key fields determine the generated DELETE statement. Executor construction
BufferReducedBatchStatementExecutor receives the change records:
INSERTandUPDATE_AFTERgo to the upsert side.DELETEgoes to the delete side, which receives the extracted key record.UPDATE_BEFOREis skipped by this buffering executor.- The buffer stores records by key. A later record for the same key within a batch replaces the earlier buffered entry.
The last point matters: this path can coalesce changes for the same key within a batch, making it suitable for maintaining current state. It is not an audit implementation that persists every event individually. This example assumes stable business keys; handling primary-key changes is outside its scope. Buffering executor source
SeaTunnel connects source change types to destination database operations within one integration job. To use that capability, select a write path with the required semantics and preserve the correct row identity.
4. Configure writes explicitly for a PostgreSQL current-state table
The following is a JDBC sink configuration fragment, not a complete job. The upstream pipeline must supply change records containing order_id and status, and the destination table must already exist.
sink {
Jdbc {
url = "jdbc:postgresql://db-host:5432/reporting"
driver = "org.postgresql.Driver"
username = "sync_user"
password = "<replace-with-your-secret>"
generate_sink_sql = true
database = "reporting"
table = "public.orders_current"
primary_keys = ["order_id"]
enable_upsert = true
use_copy_statement = false
schema_save_mode = "ERROR_WHEN_SCHEMA_NOT_EXIST"
data_save_mode = "APPEND_DATA"
is_exactly_once = false
}
}This configuration makes three choices explicit: generate write SQL, identify records by order_id, and avoid the PostgreSQL COPY path. Do not add a custom query, which would select a different execution path. JDBC sink documentation
Here, database = "reporting" names the PostgreSQL database. public is the schema and belongs in table = "public.orders_current". The connector parses the database, schema, and table name; do not put public in the database field. Table-path parsing
APPEND_DATA controls how existing destination data is treated when the job starts. It does not force every CDC event to become an INSERT. With is_exactly_once = false, this example also does not enable XA exactly-once mode. Correct delete propagation and XA are separate concerns; neither checkpoints nor primary-key configuration alone establishes end-to-end exactly-once behavior. Save-mode handling
Deployment also requires a PostgreSQL JDBC driver compatible with the database and Java versions, plus permissions to read metadata and execute the required DML. The password shown is a placeholder, not an environment-variable expression.
5. Why a custom INSERT does not automatically become a DELETE
Another job might use custom write SQL:
generate_sink_sql = false
query = "INSERT INTO public.orders_current(order_id, status) VALUES (?, ?)"This is an alternative configuration, not two lines to append to the previous example.
On this simple SQL execution path, SimpleBatchStatementExecutor converts incoming records into prepared-statement parameters and adds them to a batch. It does not inspect the change type and rewrite a supplied INSERT into a DELETE. Simple executor source
The source can therefore capture a deletion correctly while the destination still attempts an insert. Whether that insert succeeds or violates a primary-key constraint depends on the incoming values and destination table. Neither outcome proves that the deletion propagated correctly.
For a current-state destination, choose a write path that handles change types appropriately. An arbitrary custom SQL statement does not automatically acquire all CDC semantics.
6. Troubleshoot one key, then validate the pipeline
If order 42 still appears in reports, collect evidence in this order:
- Source event: Confirm that the deletion of order 42 was actually captured. Do not infer capture merely because the row is absent from the current source table.
- Transformed record: Confirm that the record arriving at the sink still carries a delete operation and the correct key.
- Executor selection: Check whether the job uses the keyed, generated-SQL path, custom SQL, or COPY.
- Destination application: Check that the batch flushed successfully, the database committed, and the job wrote to the intended database, schema, and table.
- Query visibility: Query the destination table directly, then check whether reporting queries read a replica, cache, materialized view, or another schema.
JDBC writes are buffered and batched. A record arriving at the sink is not necessarily visible to a database query yet. JDBC output implementation
Next, test insert, update, delete, and reinsertion with the same business key, and include a controlled recovery. Retain the source operation order, destination row states, and recovery records as acceptance evidence. If out-of-order replay is possible, define an ordering or version-control strategy so that an older update cannot arrive after a deletion and recreate the row.
Conclusion
SeaTunnel lets engineers organize data reads, necessary transformations, and destination writes through connectors and configuration. For continuous database synchronization, its value extends to using the right connector combination to turn business changes into the destination state the application requires.
Following a DELETE through the entire pipeline is a practical place to start: the correct operation type, a stable key, a matching write mode, and a committed, query-visible destination result are all essential.

Join the conversation! Your thoughts help the community grow.