Catalogue / pingcap-2020-tikv-multi-raft

PingCAP built TiKV on range-sharded Regions, each its own Raft group, with a stateless Placement Driver that rebuilds routing from heartbeats

PingCAP, 2020. TiKV distributed key-value store (storage layer of TiDB).

Organisation
PingCAP
Evidence
Reported from production
Source
Building a Large-scale Distributed Storage System Based on Raft

TiKV blog, published 2020-05-21

Records

Decision#d1

Shard by key range rather than by hash, keeping a table's data close together for scans and growing by splitting Regions

Decision#d2

Make every Region its own Raft group, splitting a Region through a Raft log entry once it passes 96 MB

Decision#d3

Apply one Raft membership change at a time per Region, and only after its log entry is applied

Decision#d4

Let SDK clients cache Region routes and correct them when a node answers that it is not the leader

Decision#d5

Keep the Placement Driver stateless and rebuild its routing table from node heartbeats after a restart

Decision#d6

Version Region changes with two logical clocks so PD can tell fresh heartbeats from stale ones during partitions

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.