T

TiKV Blog

tikv.org · Company blog · on HN since 2018

The TiKV project team writes about its distributed key-value database, covering Raft, performance tuning, releases, and Rust internals.

What HN saysHN commenters point to TiKV as a ready-made RocksDB plus Raft option and as a reference design for sharded replicated systems.
16HN people shared it
10linked it in comments
9stories submitted
108story points
8 months agolast shared
2018people per year2026

Most-shared posts

  1. 1
  2. 2
    How TiKV reads and writes
    1 people · 97 points · first shared 2019 · 12 comments on HN
  3. 3
    Implement Raft in Rust
    1 people · 2 points · first shared 2020 · discussion on HN
  4. 4
    TiKV 2.1 Reaches GA
    1 people · 2 points · first shared 2018 · discussion on HN
  5. 5
    TiKV 3.0 GA Release
    1 people · 1 points · first shared 2019 · discussion on HN
  6. 6
    TiKV Deep Dive
    1 people · 1 points · first shared 2019 · discussion on HN
  7. 7
    This Month in TiKV – July 2019
    1 people · 1 points · first shared 2019 · discussion on HN
  8. 8
    TiKV Performance Tuning with Regions
    1 people · 1 points · first shared 2020 · discussion on HN
  9. 9
    Some notes about migrating Rust futures 0.1 to 0.3
    1 people · 1 points · first shared 2019 · discussion on HN
  10. 10
    B tree vs lsm
    1 people · first shared 2024
  11. 11
    Isolation level
    1 people · first shared 2020
  12. 12
    Overview
    1 people · first shared 2019
  13. 13
    Timestamp oracle
    1 people · first shared 2023
  14. 14
    Introduction
    1 people · first shared 2021
  15. 15
    Data sharding
    1 people · first shared 2021

What HN people wrote when they linked it

tobiemh · 2022-08-22
Hi Diggsey, great question. We are currently focussed on functionality and stability, and then will draw our attention to performance. Coming this week we have a RocksDB storage implementation. We've only just launched our initial beta version, and we know there is a lot of improvement and work to be done (some of these performance issues we know about already and are on our Github issues list). With regards to the consistency/isolation model, SurrealDB sits on top of a number of key-value stores. By using the distributed highly-available TiKV storage backend, https://tikv.org, (and we have a FoundationDB integration in the works), the database is designed to be highly-scalable and highly-available. The same guarantees (albeit just single-node, so no high-availability or scalability) will be available with the RocksDB implementation coming this week. By sitting on top of these key-value stores, SurrealDB ensures that all transactions are ACID compliant. We don't want to go for speed (for instance by writing to /dev/null) over anything, but want SurrealDB to be a reliable and performant backend for any application. Obviously we have a way to go to catch up with PostgreSQL (launched in 1996), but we will strive to get there!
schmichael · 2026-03-17
As a longtime Raft user (via hashicorp/raft), I'm curious about your Raft implementation! You mention etcd's Raft library, but it isn't natively Multi-Raft. Is your implementation similar to https://tikv.org/deep-dive/scalability/multi-raft/ ? I'd love to hear about your experience implementing and testing it!
dragonsh · 2022-09-17
> Many,many smart people… True and if you look inside the code you can see the stated features are a result of underlying engine from those smart people (TiKV [0] in C and rust from pingcap). Surrealdb is standing on shoulders of giants at present, they are TiKV, FoundationDB and rocksdb. The feature set they mentioned mostly coming from TiKV at present. [0] https://tikv.org/
gregwebs · 2019-12-04
Those that don't want to roll their own RocksDB + Raft can consider using TiKV, which uses the RocksDB + Raft architecture. https://tikv.org/
stsffap · 2024-06-12
Restate is built as a sharded replicated state machine similar to how TiKV (https://tikv.org/), Kudu (https://kudu.apache.org/kudu.pdf) or CockroachDB (https://github.com/cockroachdb/cockroach) are designed. Instead of relying on a specific consensus implementation, we have decided to encapsulate this part into a virtual log (inspired by Delos https://www.usenix.org/system/files/osdi20-balakrishnan.pdf) since it makes it possible to tune the system more easily for different deployment scenarios (on-prem, cloud, cost-effective blob storage). Moreover, it allows for some other cool things like seamlessly moving from one log implementation to another. Apart from that the whole system design has been influenced by ideas from stream processing systems such as Apache Flink (https://flink.apache.org/), log storage systems such as LogDevice (https://logdevice.io/) and others. We plan to publish a more detailed follow-up blog post where we explain why we developed a new stateful system, how we implemented it, and what the benefits are. Stay tuned!
sargstuff · 2024-09-11
data structures making use of underlying hardware may have better performance than generic b-tree.[0][1][2][3] [0] LSM (relies on ability to cache reads) vs. b-tree : https://tikv.org/deep-dive/key-value-engine/b-tree-vs-lsm/ [1] alternatives such as c-tree (lower memory usage/query time at cost of flexibility): https://en.wikipedia.org/wiki/C-trie [2] radix variants : https://en.wikipedia.org/wiki/Radix_tree [3] striped trie (distributed/parallel searching of shards) : https://www.agdresearch.com/striped-trie
ergl · 2021-01-03
See https://tikv.org/deep-dive/key-value-engine/introduction/. You can specify the storage engine, although all the available engines in that page order the keys: rocksdb allows prefix search, and both B and LSM trees naturally order keys.
c4pt0r · 2019-12-09
TiDB/TiKV's CTO here. I don't think so, the co-founding team is not ex-Googlers, but we're all big fans of the papers published by Google, especially, the Spanner/F1/BigTable...So it's no surprise that this project has a little bit `Google flavor` Ref: https://tikv.org/docs/3.0/concepts/overview/
CodesInChaos · 2020-08-31
It's just as desirable as with a simple database since it avoids certain anomalies (write skew). For many operations it's strong enough, but it adds the risk that you run into problematic anomalies you did not anticipate. > In a write skew anomaly, two transactions (T1 and T2) concurrently read an overlapping data set (e.g. values V1 and V2), concurrently make disjoint updates (e.g. T1 updates V1, T2 updates V2), and finally concurrently commit, neither having seen the update performed by the other. Were the system serializable, such an anomaly would be impossible, as either T1 or T2 would have to occur “first”, and be visible to the other. In contrast, snapshot isolation permits write skew anomalies. FoundationDB has a workaround, but I don't know how well that works in practice. > In TiDB, you can use SELECT … FOR UPDATE statement to avoid write skew anomaly. In this case, TiDB will use locks to serialize writes together with MVCC to gain some of the performance gains and still support the stronger “serializability” level of isolation. Serializability is more expensive of course, since the database needs to track what was read and not only what was modified. It is possible to achieve this in a distributed database, FoundationDB is one example that supports it. https://tikv.org/deep-dive/distributed-transaction/isolation-level/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close