Skip to content

Alorun/stonekv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StoneKV

This is a Go implementation of a TiKV/TinyKV style distributed key-value (KV) project, module name: github.com/Alorun/stonekv. The core consists of two services: kv/main.go starts the KV gRPC server, and scheduler/main.go starts the scheduler.

Main Structure:

  • raft/: Self-developed Raft core, including election, log replication, RawNode, in-memory storage, and testing.

  • kv/server/: External gRPC API, implementing both the Raw KV and transactional (MVCC) interfaces.

  • kv/storage/: Abstract storage layer, including single-machine Badger storage and Raft-backed storage.

  • kv/raftstore/: TiKV-like logic such as Region, Peer, Raft message processing, snapshots, splitting, and scheduling heartbeats.

  • kv/transaction/: MVCC, locks, latches, and transaction command logic.

  • scheduler/: A scheduling service similar to PD, managing store/region, TSO, operator, and balance scheduler.

  • proto/: gRPC/protobuf definition and generation code.

Prerequisites: RocketDB Engine Dependency

The underlying key-value engine of this project is the self-developed RocketDB, called through the kv/util/rocketdb cgo binding.

The RocketDB C++ source code and compilation artifacts are not included in this repository, and need to be prepared locally and symbolic links created:

  1. Compile RocketDB elsewhere to obtain include/ header files and build-release/librocketdb.a
  2. Create two symbolic links in this repository (ignored by .gitignore):

ln -s /include kv/util/rocketdb/cdeps/include

ln -s /build-release kv/util/rocketdb/cdeps/lib

Then compile/test using CGO_ENABLED=1:

CGO_ENABLED=1 go build ./...

CGO_ENABLED=1 go test ./kv/util/rocketdb/

About

StoneKV is a TiKV/TinyKV-inspired distributed key-value database written in Go, featuring a self-developed Raft implementation and PD-like scheduler.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages