What changes does a key in TiDB undergo before finally landing in RocksDB?

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

Original topic: tidb的一个key最终落到rocksdb都经历哪些变化?

| username: TiDBer_jYQINSnf

I mainly want to understand what a TiDB key ultimately looks like when it lands in RocksDB.
For example: after finding the region for the key, a timestamp is added, becoming key+ts, and then there’s MVCC and the like.
I noticed there’s a DATA_PREFIX in the TiKV code. Is this added to every key?

Are there any articles that introduce this? I can find it by looking at the code, but it’s a bit slow.

| username: xfworld | Original post link

I recommend reading the main documentation, which provides detailed information on the parts you want to know:

Computation, storage, and scheduling are all related and cannot be viewed separately, otherwise, there will be omissions.

It is best to refer to the code to think about the above, I hope it helps you.

| username: TiDBer_jYQINSnf | Original post link

I asked on internals.tidb.io, and an expert answered. I’m sharing the answer here for others’ reference.

Added during the apply phase

| username: xiaohetao | Original post link

I recommend reading the main documentation, which provides detailed information on the parts you want to know:

https://docs.pingcap.com/zh/tidb/stable/tidb-best-practices
https://pingcap.com/zh/blog/tidb-internal-1

Computation, storage, and scheduling are all related and cannot be viewed separately, otherwise, there will be omissions.

It is best to refer to the code to think about the above, I hope it helps you.

| username: xiaohetao | Original post link

I will also study.

| username: xiaohetao | Original post link

:+1::+1::+1:

| username: HACK | Original post link

In different situations, the format of the key is different. You can first take a look at the content related to TiDB’s data storage format.

| username: alfred | Original post link

Also learning :wave:

| username: system | Original post link

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