Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb如何查看实时数据变化
How can TiDB view real-time data changes? For example, in MySQL, you can use “show master logs;” to see if there are insert, delete, or update operations, indicating data changes. What commands does TiDB use to view this?
Enable CDC to synchronize modification records to Kafka or similar locations such as files.
Is it necessary to enable CDC or binlog?
In the Affected Rows By Type panel in Grafana TiDB, it can display data changes.
MySQL’s master log is only available when binlog is enabled. If it’s not enabled, there won’t be any…
TiCDC can be used, and TiDB-Binlog can also be enabled, but if TiCDC needs to synchronize to downstream, it becomes somewhat redundant.
It can be directly stored on storage like S3.
You can synchronize to MySQL and view it through MySQL.
In real-time, it would be difficult to achieve without tools or secondary development. If the timeliness requirement is not high, you can use the system’s built-in table data, such as select table_name, table_rows from INFORMATION_SCHEMA.TABLES;
.
Therefore, triggers are still very necessary, as they allow you to define and capture the changes in data that you are concerned about.
I am looking at it in MinIO.
TiDB Binlog, BR log, and TiCDC can all record data changes. If you want to record SQL, you can use Binlog or enable the general log to record all SQL (including SELECT).
Enabling binlog or ticdc, can you only view real-time data changes by connecting to the downstream database? This doesn’t seem very scientific.
TiDB Binlog, BRLog, and TiCDC indeed record data changes. How can we view these data changes? Do we have to synchronize them to the downstream and view them in the downstream database?
Binlog can be parsed through repo without needing to go downstream. TiCDC has support for Kafka, but BR log does not yet have an official parsing tool.