Skip to main content

TiDB Integration Task (Beta)

A TiDB integration task synchronizes data from a TiDB cluster into TiDB Cloud Lake. It supports full Snapshot loads from a Dumpling export, continuous Change Data Capture (CDC) from a TiCDC changefeed, or a combination of both.

If you need to create reusable staging bucket settings first, see TiDB Data Source.

Use Cases​

  • Migrate TiDB databases and tables into TiDB Cloud Lake for analytics
  • Keep TiDB Cloud Lake continuously in sync with TiDB through TiCDC
  • Consolidate sharded databases into per-source target databases in one task
  • Run a full load once, or combine a full load with ongoing change capture

Sync Modes​

Sync ModeDescription
SnapshotPerforms a one-time full data load from a Dumpling export. Ideal for initial migration or periodic bulk refresh.
CDC OnlyContinuously consumes the TiCDC changefeed and applies real-time changes (inserts, updates, deletes).
Snapshot + CDCPerforms a full snapshot first, then transitions to continuous CDC. Recommended for most use cases.

Prerequisites​

Before creating a TiDB integration task, make sure:

  • A TiDB data source has already been created.
  • The object storage bucket configured in the data source is reachable from TiDB Cloud Lake.
  • The TiCDC / Dumpling export for the tables you want to sync has been written to the bucket under the prefixes you will reference in the task.

Creating a TiDB Integration Task​

Step 1: Basic Info​

  1. Navigate to Data > Data Integration and click Create Task.
  2. Select a TiDB data source, then configure the basic settings:
FieldRequiredDescription
Data SourceYesSelect an existing TiDB - Credentials data source. You can also create one from here
NameYesA name for this integration task
Sync ModeYesChoose Snapshot, CDC Only, or Snapshot + CDC
Table RulesYesRules that select which source objects to sync. See Table Rules
Max Matched TablesNoUpper bound on how many tables the rules may match. Leave empty to use the system default (500)
Dumpling S3 PrefixYes (Snapshot modes)Bucket prefix that holds the Dumpling export, for example dumpling/export
Table ParallelismNoNumber of tables loaded concurrently (default: 4)
WarehouseYesTiDB Cloud Lake warehouse used to run the task

Table Rules​

Enter one rule per line. Each rule is schemaPattern.tablePattern, optionally prefixed with ! to exclude:

app.orders an exact table
shard_*.* every table of every shard_ database
!*.tmp_* exclude temporary tables

Rules are evaluated from last to first. The first rule whose database and table patterns both match decides the outcome. An object that matches no rule is excluded. A list containing only exclusions gets an implicit leading *.*.

Each matched source database is written to its own target database, so same-named tables in different source databases stay separate. This is the only way to sync more than one source database in a single task.

Click Preview Matched Tables to evaluate the current rules against the objects actually present under the prefix. The preview lists the matched source database and table together with the derived target database and table.

Snapshot Options​

When the sync mode includes a snapshot, additional options control how the Dumpling export is loaded:

FieldDefaultDescription
Auto Create TableYesCreate the target table automatically from the source schema
Purge After LoadNoDelete source objects from the bucket after a successful load. Requires delete permission
On ErrorAbortAbort stops at the first error; Continue skips failed rows and keeps loading
CSV Separator,Field delimiter used by the Dumpling export
Skip Header RowsYesWhether the first row contains column names. Choose YES when the export has a header row
Export Escaped BackslashesNoMust match the Dumpling --escape-backslash setting.

Target Name Affixes​

Target database and table names are derived from the source names, with optional affixes:

target database = targetDatabasePrefix + sourceDatabase + targetDatabaseSuffix
target table = targetTablePrefix + sourceTable + targetTableSuffix

Leave the affixes empty to use the source names as-is. Affixes may contain only letters, digits, and underscores.

For example, with a database prefix of src_, source database shard_1 and table orders are written to src_shard_1.orders.

Step 2: Create the Task​

Review the settings, then click Create to create the integration task.

Task Behavior by Sync Mode​

Sync ModeBehavior
SnapshotRuns once and automatically stops after the full load completes.
CDC OnlyRuns continuously, consuming changefeed events until manually stopped.
Snapshot + CDCCompletes the full snapshot first, then transitions to continuous CDC until manually stopped.

For CDC tasks, progress is saved as a checkpoint. When the task is stopped and restarted, it resumes from the saved position instead of reloading from the beginning.

Advanced Configuration​

The following settings are task-level parameters that tune discovery, loading, and merging.

ParameterDefaultDescription
Table Parallelism4Controls how many tables are processed concurrently. Higher values increase throughput but consume more warehouse resources.
Poll Interval60 secondsHow often the task lists the staging bucket (and consumes the optional SQS queue) to discover new changefeed / export objects. A shorter interval reduces latency at the cost of more list requests. For OSS, discovery uses polling only.
Batch File Count100Maximum number of CDC event files processed per batch. Adjust to balance memory use and throughput.
Merge Interval30 secondsHow often captured changes are merged into the target table. A shorter interval lowers latency but increases merge activity.
Allow DeleteDisabledWhether DELETE operations captured from the changefeed are applied to the target table. When disabled, deletes are ignored and historical rows are retained.
Max Matched Tables500Upper bound on how many source tables the rules may match. If the rules exceed this limit, the task fails with the offending matches listed.
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today