Can the TiKV Java Client perform update operations?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tikv java Client可否实现update 操作

| username: 表渣渣渣

[Test Environment for TiDB] Testing
[TiDB Version] tidb 5.4.0
[Reproduction Path] Using tikv java Client to write data, it is found that even if the specified data (Object) and fields (List) are specified, the operation will still be delete first and then write.
[Encountered Issues: Problem Phenomenon and Impact]
The cause is as follows: Recently, when using flink JDBC sink to write to tidb, there was a write bottleneck. Considering using tikv java Client (KVClient) 2PC to write data, three issues were found:

  1. It is found that even if the specified data (Object) and fields (List) are specified, the operation will still be delete first and then write.
  2. Our commonly used scenario is the upsert operation (INSERT INTO **** ON DUPLICATE KEY UPDATE). After this statement writes data, tidb cdc only has one change record, but if tikv client is used to write, there will be two pieces of data, which will double the data in kafka.
  3. I have not found any relevant content on using tidb RawKVClient() encode & decode. I don’t know if this API can meet my needs. Using KVClient’s encode & decode will report an error, it seems that the encryption and decryption methods of the two are inconsistent.
| username: xfworld | Original post link

The TiDB RawKVClient has only one operation, which is put. Deletion is also done by putting, which marks the data. When performing get or scan, the marked data can be skipped. The delete operation is only executed during compacting.


The above is completely different from the operation mode of the TiDB SQL entry that you understand, so you don’t need to worry about encryption… :upside_down_face:

| username: 表渣渣渣 | Original post link

In other words, the design of TiKV itself does not allow for update operations. :clown_face:

| username: xfworld | Original post link

The standard key/value, NoSQL paradigm

It depends on how it’s used…

So there are many scenarios where TiDB is very suitable, but it needs to be used in the right place…

If you have more ideas and requirements for the scenario, feel free to share your thoughts. I believe the product experts will see your needs… :upside_down_face:

| username: 表渣渣渣 | Original post link

Got it, I’ll review my requirements again. Thank you very much for clarifying. :handshake:

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.