TiKV
TiKV is a distributed key-value database that splits ordered keys across a cluster and replicates each range. It gives applications a durable storage layer with raw key-value access or distributed transactions.
itCloud native tools and technologies | OpenSkills.info
Intro
TiKV
TiKV is a distributed key-value database. You store bytes under ordered keys, while TiKV spreads the key space across machines and keeps replicas of each part.
That sounds like a simple map with extra machinery. The machinery solves hard problems. It decides where a key lives, keeps copies consistent, moves data as the cluster changes, and coordinates transactions across key ranges.
The mental model
Picture one sorted key space cut into consecutive ranges. TiKV calls each range a Region. Each Region has several replicas, called peers, and those peers form a Raft group.
One peer is the leader. A write goes through that leader and becomes a Raft log entry. The group commits the entry after a majority accepts it. RocksDB stores the resulting data on each TiKV store.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Sources
- https://tikv.org/
Supports
- TiKV as an open-source distributed transactional key-value store
- Official documentation and project scope
- https://tikv.org/docs/dev/reference/architecture/introduction/
Supports
- Official architecture study path
- Storage, scheduling, terminology, and deeper design coverage
- https://tikv.org/docs/3.0/concepts/architecture/
Supports
- RawKV and transactional API distinction
- TiKV, PD, Store, Region, Node, Raft, RocksDB, and TiDB relationships
- Single-key versus multi-key atomicity
- https://tikv.org/docs/dev/reference/architecture/storage/
Supports
- RocksDB local persistence
- Raft leader election, membership changes, log replication, and majority commit
- Ordered key ranges, Regions, Region distribution, and PD location metadata
- Distributed transaction model
- https://tikv.org/docs/dev/reference/architecture/terminology/
Supports
- Definitions of Node, Store, Region, peer, Raft, and PD
- Region split and merge behavior
- PD scheduling responsibilities
- https://tikv.org/docs/dev/reference/architecture/scheduling/
Supports
- PD as TiKV cluster manager and Region scheduler
- Replica placement, failure recovery, leader distribution, hot-load balancing, and new-store rebalancing
- Network, disk, and CPU cost of data movement
- https://tikv.org/docs/dev/concepts/explore-tikv-features/distributed-transaction/
Supports
- TxnKV distributed transaction behavior
- Snapshot isolation and concurrent update conflicts
- https://tikv.org/docs/7.1/develop/rawkv/introduction/
Supports
- RawKV as the non-transactional API
- Raw get, put, delete, scan, time to live, compare and swap, and checksum coverage
- https://tikv.org/docs/dev/concepts/explore-tikv-features/fault-tolerance/
Supports
- Failure and recovery behavior
- Quorum-based availability boundary
- https://tikv.org/docs/dev/deploy/monitor/key-metrics/
Supports
- Grafana and Prometheus monitoring context
- Storage, gRPC, scheduler, Raft, Region, MVCC, garbage collection, and coprocessor metrics
- https://tikv.org/deep-dive/
Supports
- Advanced study areas across consensus, key-value storage, transactions, scalability, RPC, scheduling, distributed SQL, and testing
- https://docs.pingcap.com/tidb/stable/tidb-architecture/
Supports
- TiDB server as the stateless SQL layer
- TiKV as row-oriented distributed transactional storage
- PD metadata, scheduling, and timestamp responsibilities
- TiFlash as columnar analytical storage
- https://github.com/sindresorhus/awesome
Supports
- Required starting point for curated Awesome-list discovery
- Discovery of database and big-data lists
- https://github.com/oxnr/awesome-bigdata
Supports
- Curated discovery of TiDB as a distributed SQL project related to TiKV
- https://github.com/operator-framework/awesome-operators
Supports
- Curated discovery of the official TiDB Operator
- https://docs.pingcap.com/tidb-in-kubernetes/stable/tidb-operator-overview/
Supports
- TiDB Operator management scope
- Kubernetes deployment, upgrades, scaling, backup, failover, and configuration changes
