Changefeed (Beta)
TiDB Cloud changefeed helps you stream data from TiDB Cloud to other data services. Currently, TiDB Cloud supports streaming data to Apache Kafka and MySQL.
Restrictions
- Changefeeds do not support DDL statements that rename multiple tables in a single
RENAME TABLEstatement, for example,RENAME TABLE t1 TO t3, t2 TO t4. Executing this statement permanently interrupts changefeed data replication. - The changefeed throughput is approximately 20 MiB/s. If your incremental data volume exceeds this limit, contact TiDB Cloud Support for assistance.
Supported regions
The changefeed feature is available in the following regions:
| Cloud provider | Supported regions |
|---|---|
| AWS |
|
| Alibaba Cloud |
|
Additional regions will be supported in the future. For immediate support in a specific region, contact TiDB Cloud Support.
View the Changefeed page
To access the changefeed feature, take the following steps:
Log in to the TiDB Cloud console and navigate to the Clusters page of your project.
Click the name of your target cluster to go to its overview page, and then click Data > Changefeed in the left navigation pane. The changefeed page is displayed.
On the Changefeed page, you can create a changefeed, view a list of existing changefeeds, and operate the existing changefeeds (such as pausing, resuming, editing, and deleting a changefeed).
Create a changefeed
To create a changefeed, refer to the tutorials:
View a changefeed
You can view a changefeed using the TiDB Cloud console or the TiDB Cloud CLI.
- Navigate to the Changefeed page of your target TiDB cluster.
- Locate the corresponding changefeed you want to view, and click ... > View in the Action column.
- You can see the details of a changefeed, including its configuration, status, and metrics.
Run the following command:
ticloud serverless changefeed get --cluster-id <cluster-id> --changefeed-id <changefeed-id>
Pause or resume a changefeed
You can pause or resume a changefeed using the TiDB Cloud console or the TiDB Cloud CLI.
- Navigate to the Changefeed page of your target TiDB cluster.
- Locate the corresponding changefeed you want to pause or resume, and click ... > Pause/Resume in the Action column.
To pause a changefeed, run the following command:
ticloud serverless changefeed pause --cluster-id <cluster-id> --changefeed-id <changefeed-id>
To resume a changefeed:
ticloud serverless changefeed resume -c <cluster-id> --changefeed-id <changefeed-id>
Edit a changefeed
You can edit a changefeed using the TiDB Cloud console or the TiDB Cloud CLI.
Navigate to the Changefeed page of your target TiDB cluster.
Locate the changefeed you want to pause, and click ... > Pause in the Action column.
When the changefeed status changes to
Paused, click ... > Edit to edit the corresponding changefeed.TiDB Cloud populates the changefeed configuration by default. You can modify the following configurations:
- Apache Kafka sink: all configurations except Destination, Connection, and Start Position
- MySQL sink: all configurations except Destination, Connection and Start Position
After editing the configuration, click ... > Resume to resume the corresponding changefeed.
Edit a changefeed with an Apache Kafka sink:
ticloud serverless changefeed edit --cluster-id <cluster-id> --changefeed-id <changefeed-id> --name <new-displayName> --kafka <full-specified-kafka> --filter <full-specified-filter>
Edit a changefeed with a MySQL sink:
ticloud serverless changefeed edit --cluster-id <cluster-id> --changefeed-id <changefeed-id> --name <new-displayName> --mysql <full-specified-mysql> --filter <full-specified-filter>
Duplicate a changefeed
- Navigate to the Changefeed page of your target TiDB cluster.
- Locate the changefeed that you want to duplicate. In the Action column, click ... > Duplicate.
- TiDB Cloud automatically populates the new changefeed configuration with the original settings. You can review and modify the configuration as needed.
- After confirming the configuration, click Submit to create and start the new changefeed.
Delete a changefeed
You can delete a changefeed using the TiDB Cloud console or the TiDB Cloud CLI.
- Navigate to the Changefeed page of your target TiDB cluster.
- Locate the changefeed you want to delete, and click ... > Delete in the Action column.
Run the following command:
ticloud serverless changefeed delete --cluster-id <cluster-id> --changefeed-id <changefeed-id>
Changefeed billing
Changefeeds are free of charge during the beta phase.
Changefeed states
During the running process, changefeeds might fail with errors, or be manually paused or resumed. These behaviors can lead to changes of the changefeed state.
The states are described as follows:
CREATING: the changefeed is being created.CREATE_FAILED: the changefeed creation fails. You need to delete the changefeed and create a new one.RUNNING: the changefeed runs normally and the checkpoint-ts proceeds normally.PAUSED: the changefeed is paused.WARNING: the changefeed returns a warning. The changefeed cannot continue due to some recoverable errors. The changefeed in this state keeps trying to resume until the state transfers toRUNNING. The changefeed in this state blocks GC operations.RUNNING_FAILED: the changefeed fails. Due to some errors, the changefeed cannot resume and cannot be recovered automatically. If the issues are resolved before the garbage collection (GC) of the incremental data, you can manually resume the failed changefeed. The default Time-To-Live (TTL) duration for incremental data is 24 hours, which means that the GC mechanism does not delete any data within 24 hours after the changefeed is interrupted.