<commit_before>## TiKV is a distributed KV database powered by Rust.


[![Build Status](https://travis-ci.org/pingcap/tikv.svg?branch=master)](https://travis-ci.org/pingcap/tikv)


TiKV is a Distributed Key-Value Database which mainly refers to the design of Google Spanner and HBase, but much simpler (Don't depend on any distributed file system). We've implemented the Raft consensus algorithm in Rust and stored consensus state in RocksDB. It not only guarantees consistency for data but also makes use of placement driver to implement sharding (split && merge) and data migration automatically. The transaction model is similar to Google's Percolator, and with some performance improvements. In fact, we provide snapshot isolation (SI) and serializable snapshot isolation (SSI), and then externally consistent reads and writes in distributed transactions. Some details can see [Tikv-server software stack](#Tikv-server-software-stack). And some primary features list as follow.

- __Geo-Replication__  
TiKV uses Raft to support Geo-Replication. We have ported etcd's raft implementation to Rust. Raft group guarantee Key-Value region stay consistent. Placement driver is vital for Geo-Replication. Pd collects state information from the heartbeats of all Raft groups' leaders reglarly. According to load feedback and isolation judgment, pd can active a data migration automatedly and smoothly. So Geo-Replication can be guaranteed and make TiKV stable in some certain. 

- __Horizontal scalability__  
The Raft and placement driver determine horizontal scalability in TiKV. More specifically，because of reigion as a base unit of data movement in TiKV, similar to spanner's directory, security of membership changing in raft group determines indirectly horizontal scalability. Then the raft implements reigion migration automatically. In addition，scalability is also limited by placement driver. Assuming region's limit storage up to 64MB，only 500 byte needs to be managed in pd. We can see that TiKV may manage data at least in hundred TB level.

- __Consistent distributed transactions__  
Similar to Google's Spanner，TiKV supports externally-consistent distributed transactions. Placement driver plugs in a set of TS system, therefore timestamp oracle will be allocated in global. When TiKV client send transaction request to TiKV server，server will check relavant meta from the pd's etcd, and then TS generate two valid timestamps in two seperated handling phase implying start timestamps and commit timestamps. Before transaction ends, the start timestamp will be carrying on util the transaction is committed. Once transaction is committed, externally-consistent transactions succeed.

- __Coprocessor support__  
TiKV will be accessable and any application can develop on TiKV. We tend to provide a simple deployment solution soon after.

- __Working with [TiDB](https://github.com/pingcap/tidb)__  
TiKV implements a set horizontal scalable and externally-consistent  transactions-supported distributed Key-Value Database. And TiDB is focus on supporting both traditional RDBMS and NoSQL. TiDB prodive semantic translation in accessing Database. TiKV will be the best performance accessed database system thanks to internal optimization.
<commit_msg>README.md: clean up words (#402)<commit_after>## TiKV is a distributed KV database powered by Rust.


[![Build Status](https://travis-ci.org/pingcap/tikv.svg?branch=master)](https://travis-ci.org/pingcap/tikv)


TiKV is a Distributed Key-Value Database which mainly refers to the design of Google Spanner and HBase, but much simpler (Don't depend on any distributed file system). We've implemented the Raft consensus algorithm in Rust and stored consensus state in RocksDB. It not only guarantees consistency for data but also makes use of placement driver to implement sharding (split && merge) and data migration automatically. The transaction model is similar to Google's Percolator, and with some performance improvements. In fact, we provide snapshot isolation (SI) and serializable snapshot isolation (SSI), and then externally consistent reads and writes in distributed transactions. Some details can see [Tikv-server software stack](#Tikv-server-software-stack). And some primary features list as follow.

- __Geo-Replication__  
TiKV uses Raft to support Geo-Replication. We have ported [etcd's raft] (https://github.com/coreos/etcd/tree/master/raft) implementation to Rust. By using raft, Key-Value regions always stay consistent. Placement driver (or pb) is also important for Geo-Replication. Pd collects state information from heartbeats of all Raft groups' leaders regularly. According to load feedback and isolation judgment, pd can rebalance data automatically and smoothly. So Geo-Replication can be achieved, and makes TiKV always stable and balanced across regions. 

- __Horizontal scalability__  
The Raft and placement driver determine horizontal scalability in TiKV. More specifically，because of reigion as a base unit of data movement in TiKV, similar to spanner's directory, security of membership changing in raft group determines indirectly horizontal scalability. Then the raft implements reigion migration automatically. In addition，scalability is also limited by placement driver. Assuming region's limit storage up to 64MB，only 500 byte needs to be managed in pd. We can see that TiKV may manage data at least in hundred TB level.

- __Consistent distributed transactions__  
Similar to Google's Spanner，TiKV supports externally-consistent distributed transactions. Placement driver plugs in a set of TS system, therefore timestamp oracle will be allocated in global. When TiKV client send transaction request to TiKV server，server will check relavant meta from the pd's etcd, and then TS generate two valid timestamps in two seperated handling phase implying start timestamps and commit timestamps. Before transaction ends, the start timestamp will be carrying on util the transaction is committed. Once transaction is committed, externally-consistent transactions succeed.

- __Coprocessor support__  
TiKV will be accessable and any application can develop on TiKV. We tend to provide a simple deployment solution soon after.

- __Working with [TiDB](https://github.com/pingcap/tidb)__  
TiKV implements a set horizontal scalable and externally-consistent  transactions-supported distributed Key-Value Database. And TiDB is focus on supporting both traditional RDBMS and NoSQL. TiDB prodive semantic translation in accessing Database. TiKV will be the best performance accessed database system thanks to internal optimization.

{'fraction_non_alphanumeric': 0.043484825607730634, 'fraction_numerical': 0.0019628567114600634, 'mean_word_length': 5.156133828996283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '547502', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1500, 'n_words': 872}