Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB 的 CDC 事件的key和value的规则是什么?能否通过scan或者get方法直接获取到并二次消费
I have a technical question to consult: What are the rules for the key and value of TiDB’s CDC events? How to parse and encrypt this key and value? Can they be directly obtained through TiKV’s scan or get? What is the internal implementation principle?
Wait for version 8.0, which will integrate core capabilities similar to Flink and support subscriptions.
Actually, the sink end of TiCDC now supports many types. Most scenarios can be resolved by using MySQL/Kafka/Storage. If that doesn’t work, you can write your own Golang program to consume it. You can refer to the official example: tiflow/cmd/storage-consumer/main.go at release-7.5 · pingcap/tiflow · GitHub. The maturity is also quite high.
Is it currently not possible to obtain CDC events through tikv-client-java?
The only way to obtain it is through the CDC Sink interface; there are currently no other solutions.
You can also consider trying multiple CDCs for secondary consumption.
Will version 8.0 be released this year or next year?
Looking at the plan, it is scheduled for the second half of this year…
Parsing and encryption can be achieved through the relevant interfaces provided by TiDB. It is not recommended to directly operate on TiKV data.