Updating a Debezium MySQL connector with table whitelist option
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Debezium is an open-source distributed platform for change data capture (CDC). It can stream row-level changes to a downstream consumer based on the database log files. The MySQL connector for Debezium allows capturing all row-level changes within MySQL databases. One significant feature of Debezium’s MySQL connector is its ability to filter and specify which tables to capture through the table.whitelist configuration option.
Understanding the table.whitelist Configuration
The table.whitelist option is used to specify a comma-separated list of tables that you want the Debezium connector to monitor. Tables are specified in the format of databaseName.tableName, and wildcards can be used to specify multiple tables within a single command. This selective monitoring is particularly useful when dealing with large databases where only a subset of tables are relevant for streaming changes.
Here is an example on how to set this configuration:
This configuration instructs Debezium to monitor changes only in the customers and orders tables of the inventory database on dbserver1.
Steps to Update Debezium's MySQL Connector with table.whitelist
- Stop the connector: Before making any changes to the configuration, stop the running Debezium connector.
- Edit the configuration file: Locate the configuration file for your Debezium MySQL connector. This file typically ends in
.propertiesor could be configured in a JSON format inside a management tool like Kafka Connect UI. - Update the
table.whitelistsetting: Add or modify thetable.whitelistline in the configuration file to include the databases and tables you need.Example:
- Restart the connector: After saving your changes, restart the connector to apply the new settings.
- Verify the changes: Check the logs of the Debezium connector to ensure that no errors are occurring and that only changes from the specified tables are being captured and streamed.
Best Practices
- Use fully qualified table names: Avoid ambiguities by using fully qualified table names (
databaseName.tableName), especially when different databases might have tables with the same names. - Regular updates: Keep the
table.whitelistupdated with any changes in the database schema like additions of new tables relevant to your data streaming pipeline. - Consider using
table.blacklist: In scenarios where you need to exclude just a few tables from a large set, using thetable.blacklistmight be more practical. - Performance considerations: Limiting the number of tables watched can improve the performance of your Debezium connector by reducing the workload and network data.
Summary Table
| Configuration Option | Description | Example Usage |
table.whitelist | Specifies which tables to include for capture | table.whitelist = dbserver1.inventory.customers,dbserver1.inventory.orders |
table.blacklist | Specifies which tables to exclude from capture | table.blacklist = dbserver1.logs.audit_logs |
Updating the table.whitelist option in Debezium’s MySQL connector is straightforward but crucial for maintaining the efficiency and relevance of your data streaming architecture. By properly configuring which tables to monitor, organizations can ensure they are capturing only the most pertinent data changes without overloading their systems.
Related reading
- Updating multiple databases in distributed transaction
- Updating MySQL primary key
- Use MassTransit transactional outbox to update db and send multiple (batched) mails
- Use Prometheus operator with DB volume for k8s
- uses for mongodb ObjectId creation time
- Using a .php file to generate a MySQL dump
- Using ALTER to drop a column if it exists in MySQL
- Using Async/await with mongoose

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.