TiKV is an open-source, distributed, and transactional key-value database. Unlike traditional NoSQL systems, TiKV provides both classical key-value APIs and transactional APIs with ACID compliance. Built in Rust and powered by Raft, TiKV was originally created by PingCAP to complement TiDB, a distributed HTAP database compatible with the MySQL protocol.
TiKV draws inspiration from several great distributed systems from Google, such as BigTable, Spanner, and Percolator, along with the latest advancements in academia like the Raft consensus algorithm.
TiKV's architecture ensures data consistency and automatic data migration using the following components:
The quickest way to try out TiKV with TiDB is by using TiUP, a component manager for TiDB. Refer to the step-by-step tutorial.
TiKV can run separately with PD, which is the minimal deployment required.
export TIKV_VERSION=v7.5.0
export GOOS=darwin # only {darwin, linux} are supported
export GOARCH=amd64 # only {amd64, arm64} are supported
curl -O https://tiup-mirrors.pingcap.com/tikv-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
curl -O https://tiup-mirrors.pingcap.com/pd-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
tar -xzf tikv-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
tar -xzf pd-$TIKV_VERSION-$GOOS-$GOARCH.tar.gz
./pd-server --name=pd --data-dir=/tmp/pd/data --client-urls="http://127.0.0.1:2379" --peer-urls="http://127.0.0.1:2380" --initial-cluster="pd=http://127.0.0.1:2380" --log-file=/tmp/pd/log/pd.log
./tikv-server --pd-endpoints="127.0.0.1:2379" --addr="127.0.0.1:20160" --data-dir=/tmp/tikv/data --log-file=/tmp/tikv/log/tikv.log
pip3 install -i https://test.pypi.org/simple/ tikv-client
from tikv_client import RawClient
client = RawClient.connect("127.0.0.1:2379")
client.put(b'foo', b'bar')
print(client.get(b'foo')) # b'bar'
client.put(b'foo', b'baz')
print(client.get(b'foo')) # b'baz'
For instructions on deployment, configuration, and maintenance of TiKV, see the TiKV documentation. For a deeper understanding of the concepts and designs behind TiKV, visit Deep Dive TiKV.
See the Governance document for details.
View the list of TiKV Adopters.
A third-party security audit was performed by Cure53. See the full report here.
To report a security vulnerability, email the TiKV-security group.
See Security for the process and policy.