This Month in TiKV - July 2020

TiKV Authors

July 30, 2020


The warmest month in the Northern Hemisphere is coming to an end soon. It’s time to wrap up everything we have achieved in July! Let’s get started. News TiKV is up for graduation from CNCF! This is a major milestone we have been waiting for, which consummates the efforts and commitments of the TiKV community since it was born. It would not be possible without you, our contributors and adopters! If you would like to support TiKV in the vote, follow the instructions to join the CNCF TOC group and post your replies here!

Announcing the Transaction SIG

The transaction SIG

July 21, 2020


TiKV has been open source since almost its beginning. Over the past year or so we’ve been trying to build a better, more open community around TiKV. Recently, we’ve been forming special interest groups (SIGs) to better organize and govern our community. Today, we are pleased to announce the official launch of the Transaction SIG. Transactions Transactions have been part of database systems for decades. In distributed databases they are the key mechanism for supporting properties such as isolation and consistency (well known from the ACID property and the CAP theorem), in other words, making it possible to manage a distributed database in a similar way to a non-distributed one.

This Month in TiKV - June 2020

TiKV Authors

July 1, 2020


How time flies! It’s halfway through the year already! We are expecting the next six months of this year to be as fruitful as the first six. Let’s take a look at what we have achieved in June! News TiKV 4.0 has reached general availability! Thanks to all users and contributors who helped with the release! TiKV has been used by more than 1,000 adopters in production scenarios across multiple industries worldwide.

TiKV 4.0 GA Release

The TiKV Authors

June 18, 2020


We are excited to announce the general availability of TiKV 4.0! We’re so glad and proud to have seen more than 1000 adopters use TiKV in production scenarios across multiple industries worldwide. Thanks to all users who have given us feedback, bug reports, and pull requests contributions over the past year. We’ve applied the lessons learned from these deployments to bring new features and better security to support users’ growing needs.

TiKV Performance Tuning with Massive Regions

Bokang Zhang

June 11, 2020


In TiKV clients, data is split into Regions, each storing data for a specific key range. These Regions are distributed among multiple TiKV instances. As data is written into a cluster, millions of or even tens of millions of Regions are created. Too many Regions on a single TiKV instance can bring a heavy burden to the cluster and affect its performance. This article introduces the workflow of Raftstore (a core module of TiKV), explains why a massive amount of Regions affect the performance and offers methods for tuning TiKV performance.

This Month in TiKV - May 2020

TiKV Authors

May 28, 2020


As the summer tiptoed in, we were cheerful about everything it brings to us: sunshine, ice cream, and a busy but fulfilling May! Let’s take a look at what we have accomplished. News The first CNCF ambassador spotlight goes to Queeny Jin, who has been spreading the word about TiKV to English speakers since its inception in 2016. We appreciate Queeny’s contribution and “together we can go further!” The full blog is available here.

TiKV in JD Cloud & AI

Can Cui

May 26, 2020


Industry: Cloud Computing Author: Can Cui (Infrastructure Specialist at JD Cloud & AI) JD Cloud & AI is a smart technology provider under JD Group and is built upon JD Group’s business expertise and technological accumulations in areas such as artificial intelligence, big data, cloud computing and the internet of things. It has established a technology ecosystem that delivers unmatched customer value through comprehensive services spanning from foundational platform building to business consultation and planning, business platform construction and operations and maintenance, and is driven by industry leading products that enable smart and digital enterprises and governments through solutions across a wide variety of scenarios.

Building a Large-scale Distributed Storage System Based on Raft

Edward Huang

May 21, 2020


In recent years, building a large-scale distributed storage system has become a hot topic. Distributed consensus algorithms like Paxos and Raft are the focus of many technical articles. But those articles tend to be introductory, describing the basics of the algorithm and log replication. They seldom cover how to build a large-scale distributed storage system based on the distributed consensus algorithm. Since April 2015, we PingCAP have been building TiKV, a large-scale open-source distributed database based on Raft.

Implement Raft in Rust

Siddon Tang

May 14, 2020


Consensus is one of the most important challenges in designing and building distributed systems–how to make sure multiple nodes (or agents, processes, threads, tasks, participants, etc.) in a group agree on a specific value proposed by at least one of the nodes. As an open-source distributed transactional key-value database, TiKV uses the Raft Consensus Algorithm to ensure data consistency, auto-failover, and fault tolerance. TiKV has thus far been used by almost 1000 adopters in their production environments in a wide range of industries, from e-commerce and food delivery, to fintech, media, gaming, and travel.

This Month in TiKV - April 2020

TiKV Authors

April 30, 2020


April 1st marked TiKV’s 4th birthday. We are grateful for the support and contribution of the community while focusing on making a better TiKV. Let’s take a look at what we have achieved in April! News We’re working on another API - VerKV, a multi-versioned KV without transactions, to help TiKV expand application scenarios. It is an API halfway between RawKV and TxnKV. The work plan proposed by @fredchenbj is available here; join us by picking a task you are interested in!

Quickly Find Rust Program Bottlenecks Online Using a Go Tool

Ke’ao Yang

April 23, 2020


Profiling large Rust applications online is difficult. Current profilers are not up to the job. When we need to analyze a Rust program’s performance, we often think about perf. To use perf, we need to: Install a complete perf program to sample stack traces. Use a set of script tools to process the file obtained by sampling. Visualize the output of the processing result in the previous step.

Tick or Tock? Keeping Time and Order in Distributed Databases

Siddon Tang

April 16, 2020


Preface At re:Invent 2017, Amazon Web Services (AWS) announced Amazon Time Sync Service, a highly accurate and reliable time reference that is natively accessible from Amazon EC2 instances. It is much like the Google TrueTime published in 2012. Why do Google and AWS both want to make efforts to provide global time service? Is there any inspiration for building a distributed database? This topic is important to think about.

This Month in TiKV - March 2020

TiKV Authors

April 2, 2020


In this unprecedented global situation, we hope you can all keep a positive attitude and stay healthy. Let’s take a look at what we have achieved in March! News TiKV has finished a third-party security assessment! This assessment of the TiKV scope, commissioned by CNCF and executed by Cure53 in early 2020, concludes with generally positive results. The full report is available here. The TiKV community held the first-ever community meeting on March 26, 2020.

RocksDB in TiKV

Siddon Tang

March 18, 2020


This is the speech presented by Liu (Siddon) Tang at the RocksDB meetup on August 28, 2017. Some of the content has been adapted to be up to date. Speaker Introduction Why did we choose RocksDB? How are we using RocksDB? TiKV Architecture Region Raft InsertWithHint Prefix Iterator Table Property for Region Split Check Table Property for GC Check Ingest the SST File Others How are we contributing?

This Month in TiKV - February 2020

TiKV Authors

March 12, 2020


As the cold winter has passed, we are welcoming a beautiful spring with blossoms, gentle breeze, and of course our monthly TiKV update, covering February 2020. Let’s get started! Releases This month our team made 2 TiKV releases! You can review the changelogs here: 3.0.10 bug fixes 4.0.0-beta.1 bug fixes compatibility improvements new features including supporting fetching configuration items from the status port via HTTP API in #6480 and optimizing the performance of Chunk Encoder in Coprocessor in #6341 Reading materials For raft-based implementations like TiKV, stale read may happen due to a brain split in the Raft group.

TiKV Security Audit Results

TiKV Authors

March 5, 2020


Today we’re glad to announce that TiKV just finished a third-party security assessment, funded by CNCF/The Linux Foundation. From Feb 10 to March 03, 2020, the team from Cure53 performed comprehensive tests on TiKV in the following aspects: General security posture checks that entail: Language specifics (Rust) External Libraries & Frameworks Configuration Concerns Access Control Logging/Monitoring Unit/Regression and Fuzz-Testing Documentation Security Contact/Fix Handling Bug Tracking & Review Process Manual code auditing & penetration testing This independent security audit was performed on locally installed systems, as well as with a typical production environment provided by the TiKV team.

How TiKV Uses "Lease Read" to Guarantee High Performances, Strong Consistency and Linearizability

Siddon Tang

February 27, 2020


TiKV, an open source distributed transactional key-value store (also a Cloud Native Computing Foundation incubating project), uses the Raft consensus algorithm to ensure strong data consistency and high availability. Raft bears many similarities to other consensus algorithms like Paxos in its ability to ensure fault-tolerance and its performance implementations, but generally easier to understand and implement. While our team has written extensively on how Raft is used in TiKV (some examples: Raft in TiKV, the Design and Implementation of Multi-raft, Raft Optimization), one topic we haven’t discussed is when stale read happens due to a brain split within a Raft group, and the old Raft leader is not aware that a new leader is elected, what should we do?

This Month in TiKV - January 2020

TiKV Authors

February 19, 2020


Welcome to the first monthly wrap-up of 2020. In January, we had regular releases, some great articles, some great PRs and issues, and of course, new members of the community. Let’s take a look! Releases This month our team made 2 TiKV releases: The 3.0.9 release includes the configuration change to speed up the Region scattering, some optimized configuration items, and a fixed issue for Region Merge. The 4.0.0-beta release includes major updates such as quick backup and restoration support, RocksDB version upgrade, and also bugs fixes.

The Rust Compilation Calamity

Brian Anderson

January 31, 2020


The Rust programming language was designed for slow compilation times. I mean, that wasn’t the goal. As is often cautioned in debates among their designers, programming language design is full of tradeoffs. One of those fundamental tradeoffs is run-time performance vs. compile-time performance, and the Rust team nearly always (if not always) chose run-time over compile-time. So Rust compile times are bad. This is kinda infuriating, as almost everything that matters about Rust is pretty damn good.

This Month in TiKV - December 2019

Ana Hobden

January 18, 2020


Happy new year and happy new decade! How did our contributors wrap up the decade? Let’s take a look, and then take a peek at what’s coming this year! Releases This month our team made 4 TiKV releases - 3.0.x and 2.1.x releases are minor releases, and 3.1.0-beta is our upcoming next major release before 4.0. You can review the changelogs here: 3.0.7 3.0.8 2.1.19 3.1.0-beta Upgrading? Here’s things you should know:

This Month in TiKV - November 2019

Ana Hobden

December 11, 2019


As winter descends on the northern hemisphere, we encourage you to keep warm by compiling TiKV! In November we had new minor releases, a new crate release, and some community updates! Let’s take a look! Releases This month our team made 2 minor TiKV releases! You can review the changelogs here: 2.1.18 3.0.6 Upgrading? Things to note: In 3.0.6, #5697 introduced the ability to generate flamegraphs of TiKV at runtime!

How TiKV reads and writes

Tang Liu

December 6, 2019


This article introduces in detail how TiKV handles read and write operations. Together we will explore how TiKV, as a distributed key-value (KV) database, stores the data contained in a write request and how it retrieves the corresponding data with consistency guaranteed. Before you read it Before we begin, we need to introduce some essential concepts of TiKV to help you fully understand the process. If you are already familiar with these, you can skip to the next section.

TiKV celebrates 200 contributors!

Tang Liu

November 22, 2019


Dear TiKV contributors: As you might’ve noticed, the TiKV project has recently hit its 200th contributor in its core repository. This marks a very important milestone in our community growth. As the lead of the TiKV team at PingCAP and the senior Maintainer of the TiKV project, I would like to thank you all for helping us achieve this milestone. TiKV was originally created by PingCAP to complement TiDB in Jan, 2016 and open sourced in April, 2016.

This Month in TiKV - October 2019

Ana Hobden

November 20, 2019


It’s time for a very non-spooky October edition of This month in TiKV! We have a few treats for you while we’ve been teaching TiKV some new tricks. News This month our team made one TiKV minor release (v3.0.5)! This release includes bug fixes and minor, backwards compatible features. You can review the changelogs here: 3.0.5 Upgrading? This release includes only bugfixes! Reading materials PingCAP wrote “INSERT INTO tidb.hackathon_2019 VALUES (“Hack”, “Fun”, “TiDB Ecosystem”)" talking about the recent Hackathon they held in China!

This Month in TiKV - September 2019

Ana Hobden

October 18, 2019


Wonderful day! Welcome to the third edition of ‘This Month in TiKV’, covering September 2019. News This month our team made one TiKV minor release (v3.0.4)! This release includes bug fixes and minor, backwards compatible features. You can review the changelogs here: 3.0.4 Upgrading? Please take note of these things: There is a new batch split region command. There is a new grpc-memory-pool-quota configuration option. Reading materials Here are some articles our contributors have published over the last month:

This Month in TiKV - August 2019

Ana Hobden

September 18, 2019


Happy day! Welcome to the second edition of ‘This Month in TiKV’, covering August 2019. (Yes we know it’s later than the first week of September, sorry!) The TiKV authors have been busy working on improving stability, fixing bugs, and laying out the foundations of TiKV 4.0. That is a lot to cover, so let’s get started! News This month our team made four TiKV minor releases! These minor releases include bug fixes and minor, backwards compatible features.

Migrating the TiKV Rust client from futures 0.1 to 0.3

Nick Cameron

August 7, 2019


I recently migrated a small/medium-sized crate from Futures 0.1 to 0.3. It was fairly easy, but there were some tricky bits and some things that were not well documented, so I think it is worth me writing up my experience. The crate I migrated is the Rust client for the TiKV database. It is about 5500 LoC and uses futures fairly heavily (because it communicates with TiKV using gRPC and the interface to that is async).

This Month in TiKV - July 2019

Nick Cameron

August 7, 2019


Hi! Welcome to the first ever edition of ‘This Month in TiKV’, covering July 2019. As the name suggests, this is a monthly newsletter covering interesting things happening in the world of TiKV, an open-source, distributed key-value store. We’re just getting started with the newsletter, and you should expect it to evolve as we go along. We hope to cover news and events of interest to TiKV contributors and users, significant PRs and issues in the TiKV repo, and generally keep you informed of what is going on.

TiKV 3.0 GA Release

July 17, 2019


Today we’re proud to announce the general availability of TiKV 3.0! Whether spanning hundreds of nodes or storing over a trillion key-value pairs, we’ve seen our users put TiKV to the test in serious, real-world, production scenarios. In 3.0, we’ve applied the lessons learned from these deployments to bring a host of new features that can better support users’ growing demands. Before release, TiKV 3.0 additionally underwent an official Jepsen test with TiDB.

Distributed Systems Training in Rust and Go

Brian Anderson, Senior Database Engineer for TiKV

June 20, 2019


On the TiKV team we love the Rust and Go programming languages. They are the languages in which we write most of our software, with TiKV in Rust, and its sister project, TiDB, in Go. They have empowered us to build these fast and reliable distributed systems from the ground up, and iterate on them quickly and confidently. These languages are the future of systems programming. Creating reliable distributed systems like TiKV demands a lot from contributors — they not only need to be experts in storage and distributed systems, but also to be comfortable expressing that knowledge in these modern languages.

CNCF TOC votes to move TiKV to Incubating Status

The TiKV Team

May 21, 2019


Today, the Cloud Native Computing Foundation’s (CNCF) Technical Oversight Committee (TOC) voted to accept TiKV as an incubation-level hosted project. The full announcement can be found on the CNCF blog, and you can find us listed under the CNCF Incubating Projects. We’d like to thank all of our contributors, users, and advocates over the last several years for helping us reach this very important milestone! Thank you! As a CNCF incubating project we’ll continue to enjoy many of the benefits and services the foundation offers, as well as greater worldwide visibility.

TiKV Community Connections

Ana Hobden, TiKV Ecosystem Lead

April 3, 2019



TiKV 2.1: More Raft, Less Hotspots

Siddon Tang, Chief Engineer at PingCAP and TiKV Project Lead

December 4, 2018