The Relationship Between Region, Raft Log, and Raft Group

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

Original topic: Region、Raft log、Raft Group之间的关系

| username: TiDBer_fiJaQjDR

Each Region has multiple replicas, and each replica has a raft log. The multiple replicas of each Region correspond to a Raft group. Within each Raft group, there is one leader and multiple followers… Please advise if my understanding is correct.

| username: TiDBer_jYQINSnf | Original post link

You understand it very well.

| username: TiDBer_fiJaQjDR | Original post link

The region leader corresponds to the leader of the raft log, right? The region leader synchronizes data replicas in TiKV. Is it actually using the leader of the raft log to synchronize? Or does the region leader not correspond to the leader of the raft log?

| username: 这里介绍不了我 | Original post link

In the architecture of TiDB, all data is split into certain key ranges, and these small chunks are called Regions. These Regions are distributed across multiple TiKV instances. A Raft Group is composed of multiple Regions, and each Region has its own Raft Group.

The Raft Log is a part of the Raft Group, and it is used to record every data change. When data changes occur, these changes are first written to the Raft Log and then synchronized to all Regions in the Raft Group through the Raft protocol to ensure data consistency.

Therefore, the relationship between Region, Raft Log, and Raft Group is as follows: Region is the basic unit of data splitting, Raft Group is the unit of data replication and synchronization composed of multiple Regions, and Raft Log is the tool for recording data changes and ensuring data consistency.

For more details, refer to this document TiDB Storage | PingCAP Documentation Center

| username: TiDBer_fiJaQjDR | Original post link

Thank you, master.

| username: TiDBer_fiJaQjDR | Original post link

There is no distinction between leader and follower in the raft log, right?

| username: 这里介绍不了我 | Original post link

No, there isn’t. For a Region, it is divided into leader and follower.

| username: TiDBer_QYr0vohO | Original post link

No problem understanding.

| username: 洪七表哥 | Original post link

The raft log and data are a whole, and each replica has a copy.

| username: 随缘天空 | Original post link

No problem.

| username: TiDBer_JUi6UvZm | Original post link

No problem.

| username: zhaokede | Original post link

Not bad, read more documentation.

| username: shigp_TIDBDBER | Original post link

The raft log and data are a whole, and each replica has a copy.

| username: wangkk2024 | Original post link

Got sidetracked.

| username: system | Original post link

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