Giter Club home page Giter Club logo

community's Introduction

tikv_logo

Build Status Coverage Status CII Best Practices

TiKV is an open-source, distributed, and transactional key-value database. Unlike other traditional NoSQL systems, TiKV not only provides classical key-value APIs, but also 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.

The design of TiKV ('Ti' stands for titanium) is inspired by some great distributed systems from Google, such as BigTable, Spanner, and Percolator, and some of the latest achievements in academia in recent years, such as the Raft consensus algorithm.

If you're interested in contributing to TiKV, or want to build it from source, see CONTRIBUTING.md.

cncf_logo cncf_logo

TiKV is a graduated project of the Cloud Native Computing Foundation (CNCF). If you are an organization that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details about who's involved and how TiKV plays a role, read the CNCF announcement.


With the implementation of the Raft consensus algorithm in Rust and consensus state stored in RocksDB, TiKV guarantees data consistency. Placement Driver (PD), which is introduced to implement auto-sharding, enables automatic data migration. The transaction model is similar to Google's Percolator with some performance improvements. TiKV also provides snapshot isolation (SI), snapshot isolation with lock (SQL: SELECT ... FOR UPDATE), and externally consistent reads and writes in distributed transactions.

TiKV has the following key features:

  • Geo-Replication

    TiKV uses Raft and the Placement Driver to support Geo-Replication.

  • Horizontal scalability

    With PD and carefully designed Raft groups, TiKV excels in horizontal scalability and can easily scale to 100+ TBs of data.

  • Consistent distributed transactions

    Similar to Google's Spanner, TiKV supports externally-consistent distributed transactions.

  • Coprocessor support

    Similar to HBase, TiKV implements a coprocessor framework to support distributed computing.

  • Cooperates with TiDB

    Thanks to the internal optimization, TiKV and TiDB can work together to be a compelling database solution with high horizontal scalability, externally-consistent transactions, support for RDBMS, and NoSQL design patterns.

Governance

See Governance.

Documentation

For instructions on deployment, configuration, and maintenance of TiKV,see TiKV documentation on our website. For more details on concepts and designs behind TiKV, see Deep Dive TiKV.

Note:

We have migrated our documentation from the TiKV's wiki page to the official website. The original Wiki page is discontinued. If you have any suggestions or issues regarding documentation, offer your feedback here.

TiKV adopters

You can view the list of TiKV Adopters.

TiKV software stack

The TiKV software stack

  • Placement Driver: PD is the cluster manager of TiKV, which periodically checks replication constraints to balance load and data automatically.
  • Store: There is a RocksDB within each Store and it stores data into the local disk.
  • Region: Region is the basic unit of Key-Value data movement. Each Region is replicated to multiple Nodes. These multiple replicas form a Raft group.
  • Node: A physical node in the cluster. Within each node, there are one or more Stores. Within each Store, there are many Regions.

When a node starts, the metadata of the Node, Store and Region are recorded into PD. The status of each Region and Store is reported to PD regularly.

Quick start

Deploy a playground with TiUP

The most quickest to try out TiKV with TiDB is using TiUP, a component manager for TiDB.

You can see this page for a step by step tutorial.

Deploy a playground with binary

TiKV is able to run separately with PD, which is the minimal deployment required.

  1. Download and extract binaries.
$ 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
  1. Start PD instance.
$ ./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
  1. Start TiKV instance.
$ ./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
  1. Install TiKV Client(Python) and verify the deployment, required Python 3.5+.
$ 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'

Deploy a cluster with TiUP

You can see this manual of production-like cluster deployment presented by @c4pt0r.

Build from source

See CONTRIBUTING.md.

Client drivers

If you want to try the Go client, see Go Client.

Security

Security audit

A third-party security auditing was performed by Cure53. See the full report here.

Reporting Security Vulnerabilities

To report a security vulnerability, please send an email to TiKV-security group.

See Security for the process and policy followed by the TiKV project.

Communication

Communication within the TiKV community abides by TiKV Code of Conduct. Here is an excerpt:

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

Social Media

Slack

Join the TiKV community on Slack - Sign up and join channels on TiKV topics that interest you.

License

TiKV is under the Apache 2.0 license. See the LICENSE file for details.

Acknowledgments

  • Thanks etcd for providing some great open source tools.
  • Thanks RocksDB for their powerful storage engines.
  • Thanks rust-clippy. We do love the great project.

community's People

Contributors

5kbpers avatar andremouche avatar andylokandy avatar bornchanger avatar breezewish avatar busyjay avatar connor1996 avatar dcalvin avatar disksing avatar glorv avatar hi-rustin avatar hicqu avatar iosmanthus avatar jackysp avatar lhy1024 avatar little-wallace avatar lonng avatar nolouch avatar nrc avatar overvenus avatar rleungx avatar rustin-bot avatar skyzh avatar sunxiaoguang avatar tennyzhuang avatar tisonkun avatar tonyxuqqi avatar winkyao avatar yiwu-arbug avatar zhangjinpeng87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

community's Issues

Update governance document

Due to the fact that the governance document has been outdated for some time. I hereby propose a refresh of governance document according to the new affiliations of steering committee members and infra members.

The changes are:

  • Clear steering committee member Jay Li's affiliation based on his own preference.
  • Replace infra members, Zili Chen and Qiang Zhou, to Junchen Ye and Wuhui Zuo.

Please make comments if you have any concern, thanks

Transfer rocksdb-rs Repo to tikv org

Background

To evolve towards the next generation database engine kernel, we reimplemented RocksDB using rust. This is our project address: https://github.com/rust-lib-project/rocksdb-rs. Of course, we will not implement all the functions of RocksDB. Our purpose is to create a more general KV data engine for TiKV services, not a transactional data engine for MyRocks services. In this project, we will eliminate most of the features that TiKV in RocksDB does not use, including transactions and two-phase commit code, in order to simplify our code as much as possible and make the project easier to maintain.
For the cloud ecosystem, asynchronous IO is essential for high-latency cloud disks. Fortunately, rust provides an asynchronous framework that is easier to use than C++, allowing us to easily write asynchronous IO code. Therefore, most of the interfaces of this project are provided as asynchronous method. Thanks to all interfaces supporting asynchrony, we can merge the compaction thread pool with other background thread pools in tikv to reduce thread switching and control CPU resources more precisely.
At present, rocksdb-rs still maintains similar interface methods and functions as rocksdb, but it adopts a low-coupling architecture, which can be easily refactored into a more friendly interface for TiKV in the future.

Roadmap

At present, the project has implemented the basic functions of rocksdb, including read and write queries and background merging. But it still lacks a lot of tests, and some key functions (you can see more details in https://github.com/rust-lib-project/rocksdb-rs/issues), I hope he can get help from more developers under the tikv organization and play a bigger role.

Update authentication mechanism

subtask of #118

Since our permissions are flatten into repository level. @hi-rustin and I tend to use GitHub team to maintain the permission and leave the bot simply respect GitHub permission.

ti-chi-bot can apply such rules according to this page

use_github_permission: Use GitHub permissions and have write and admin collaborators as reviewers and committers

And for repositories where bot is not configured (bot has a limit on events received), the model retains.

Proposal: Reduce the Entropy of TiKV Community Governance

Subtasks:

What is the problem our community meet?

  • Most of our repositories have no clear owners; for example, it is hard to say who has review or commit permission of mur3 by our governance and community information.
  • Special Interest Group benefits domain-specific discussion, but sucks when coupled with governance; for example, it is hard to say a contributor contributing to TiKV security belongs to which SIG. It is to be blamed for that many of our committer level contributors (e.g., @innerr) don't become committers really.
  • We have no active exit mechanism with which we take down review or commit permission of member abuses. And thus our community is a bit closed to involve new member, and break down members into SIGs even in one repository for limiting permission which sucks.

What is proposed to do?

  • Break down the review and commit permission group into teams, one team could own one or more repositories.
  • Associate every repository with one and one and only one team.
  • Define the team governance to include explicit exit mechanism, and community governance to build new team.

Details about actions

Break down the review and commit permission group into teams.

A team has its reviewer, committer and maintainer, and owns one or more repositories.

The permission of reviewer and committer is similar with current state but indistinguishable among the team. It means a reviewer of the team can review all pull requests in repositories owned by the team.

The permission of maintainer, based on that of committer, is mainly for exit mechanism and other team level decision making, which will be elaborated later.

Within this proposal, there are 4 teams proposed.

  • TiKV team
  • PD team
  • Prometheus team
  • Raft team

Associate every repository with one and one and only one team.

Every repository of TiKV org will be associated with one and only one team. Reviewer and committer of that team has the review or commit permission to the repository.

As we build 4 teams above, the relation between team and repository as listed below. Comment if you think it is not the real case.

PD team pd
Prometheus team rust-prometheus
Raft team raft-rs
TiKV team tikv
client-c
client-py
client-go
client-java
client-rust
client-cpp
agatedb
async-speed-limit
bytes
client-validator
copr-test
crc64fast
crossbeam
fail-rs
grpc-rs
importer
jemalloc
jemallocator
minitrace-go
minitrace-rust
minstant
mock-tikv
mur3
pprof-rs
procinfo-rs
protobuf-build
raft-engine
rocksdb
rusoto
rust-rocksdb
sig-transaction
sysinfo
terraform-tikv-bench
tikv-operator
tikv.github.io
titan
tlaplus-specs
website
yatp

The exceptions are tikv/community and tikv/rfcs.

  • tikv/rfcs is associated with all teams which means we put rfcs together among teams.
  • tikv/community is for governance and only the maintainers has permission.

Define the team governance to include explicit exit mechanism, and community governance to build a new team.

A team has its reviewer, committer and maintainer.

  • A reviewer is able to review pull request for quality and correctness of repositories associated with the team. His/Her LGTM is counted.
  • A committer is able to both review and commit pull request.
  • A maintainer, based on the rights of a committer, is able to promote or evict(emeritus member for reference) a reviewer, a committer or a maintainer by majority decision.

The maintainers is able to evict member by majority decision and thus we have an exit mechanism. It is suggested that a team defines its own bylaws to elaborate other team level decision making process.

Besides the teams, the whole TiKV community has its TOC members for evolving the community. The TOC members consist of part of maintainers of teams and are in charge of community level decision making process like build a new team, or arbitrate divergence between team by majority decision.

Where do current things go?

Here is the migration details from current SIG membership to team membership.

migration sig-scheduling migrates to PD team
sig-raft migrates to Raft team/> sig-engine / sig-coprocessor / sig-transaction migrate to TiKV team

techLeaders and coLeaders migrate to maintainers
committers migrates to committers
reviewers migrates to reviewers
activeContributors are dismissed
specifically, inactive previous TiKV maintainers(@lidaobing, @siddontang, @sunxiaoguang, @winkyao, @fredchenbj) have the opportunity to be an active TiKV maintainers and thus TOC members by asking for it, otherwise they become emeritus TOC members.

Where does SIG concept go?

SIG itself means expert group, which always exists in fact, and serves for better reference to help. However, this concept should never be associated with permission.

Shall we add a new concept / infra named "Team"?

Yes and no. We name it as "Team" for distinguished from "SIG", but the authentication #123 is quite similar as "SIG at repo granularity" or said GitHub teams. There is no much difference.

Update community governance description

subtask of #118

With consensus in #118 we'd like to formalize the governance and make it no longer a draft. This issue is a subtask tracing all contents updates. So far, it seems containing

  • TOC description
  • Team description

Also we should remove all stale contents including committee/, sig/, and wg/.

cc @luzizhuo @gingerkidney

subtasks

Transfer `components/match_template` to tikv org

match_template is a procedural macro that generates repeated match arms by pattern, which is almost the only way to dispatch code path to static types depending on a runtime value. Since it's general enough, I propose to move it to TiKV org and then publish it to crates.io so that the rust community could be benifit from it.

Associate every repository with one and one and only one team

subtask of #118

Here is the dedicated issue for making decision on member : team : repository mappings.

A team has its reviewer, committer and maintainer, and owns one or more repositories.

The permission of reviewer and committer is similar with current state but indistinguishable among the team. It means a reviewer of the team can review all pull requests in repositories owned by the teams.

The permission of maintainer, based on that of committer, is mainly for exit mechanism and other team level decision making, which will be elaborated later.

I create a pull request #122 with the proposed teams and their members as well as repositories associated with.

Nominate Qi Liu as TOC Member

As one of the founders of TiKV project, Qi Liu has made significant contributions to TiKV. I hereby nominate Qi Liu as member of TOC.

Everyone is welcome to comment.

Maintainess issue of pprof-rs

Maybe when he is not that tired, he'd like to contact someone who knows the community rule of the tikv to help him solve the problem.

Based on my knowledge, only tikv committers can push tags directly.

Possible solutions include as follows:

  • Inviting one of the committers to take care of this project, maybe @andylokandy? They don't need to take part in the development, just need to push tags for release. I think it's not a big burden since pprof-rs is not heavy traffic.
  • Ping one of tikv's maintainers to give you more rights on this project. Because it doesn't make sense that you are the maintainer of pprof-rs but don't have permission to push tags.
  • Transfer this project out of tikv's umbrella if the tikv community doesn't have an interest in maintaining it.

Also, ping @tisonkun for more advice about the current situation.


Databend depends heavily on pprof-rs and I'm interested in maintaining pprof-rs, we can help maintain this project.

Originally posted by @Xuanwo in tikv/pprof-rs#139 (comment)

Change the method of PR associated issue

In voting-150, we passed the scheme of using commit message in the PR to associate the issue, so that the squash commit can also associate with the issue.

But in the process of practice, it will bring some troubles to code contributors, especially in the case where we have multiple release branches, we need to submit meaningless commits or modify the commit message many times to pass the check.

For now, we forked out a customized version of prow, which is the upstream code repository of the @ti-chi-bot .

Based on it, we add some functions to make @ti-chi-bot be able to automatically extract issue numbers from the PR body and automatically populate the issue number to the squash commit message when merging.

For example:

We just need to fill in a line starting with Issue Number: of text in the PR body. (For concrete rules, please refer to the description in the TiDB development guide.)

image

The robot will extract the issue number section in the squash commit message when merging.

image

I think that this schema replacing our original schema will make our work easier. If that makes sense to everyone, I will

  1. Disable the format-checker on tikv and pd repo, no longer enforcement requires issue number in PR's commmit.

  2. Call for a public vote on the new schema, continue to complete the issue #149 ( cc: @zhangyangyu )

Transfer TiKV Dev Guide Repo to tikv org

Proposal: TiKV Development Guide was posted at 2021-07-21, and during the last half year we finished several chapter of the guide at https://github.com/tisonkun/tikv-dev-guide.

However, there're still 36 outstanding issues and thus at least 36 sections to be written. After a discussion with @zz-jason, he proposed that we can transfer the dev guide to tikv org and proceed the work.

I'm glad to see any pull requests to fulfill new sections, and don't insist on what owner the repo belongs to. The important thing, from my side, is the content itself. If transferring the repo to tikv org can help moving forward the progress, I'm willing to do so.

So here is the issue to discuss about such a transfer. Looking forward to responses.

For achieving the transfer, I think I have all required permission to do it.

Transfer tidb_xxxx components to pingcap org

Due to historical reasons, components like tidb_query_aggr, tidb_query_expr etc. are put in tikv repository as they are part of coprocessor. But it may not be a good choice as they are highly tidb specific, may not suitable for a general KV project. And we also lack of active maintainers/committers for these components. So I suggest to move these components to pingcap org.

The components to be moved include:

  • tidb_query_expr
  • tidb_query_codegen
  • tidb_query_common
  • tidb_query_datatype
  • tidb_query_executors

They also depend on some of internal components including

  • log_wrappers
  • codec
  • collections
  • tikv_util
  • file_system

They should be either published to crates.io or inlined all used functions/types.

After this change, these projects will not be part of tikv/tikv anymore. But they will still be part of release binaries.

Any thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.