Skip to content

Alorun/rocketdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RocketDB

Project Introduction

RocketDB is a local key-value database implementation based on the LSM-Tree approach, with an overall structure similar to LevelDB. It supports basic Put, Get, Delete, batch writes, iterators, snapshots, range compression, database repair, and destruction interfaces. The core write path consists of a WAL log and a MemTable. Data is ultimately flushed to SSTable files, and multi-level file versions and background compaction are managed through MANIFEST/VersionSet.

Main Modules

  • Public API: include/db.h:35, include/options.h:22

  • Database Core: src/db/db_impl.cc:124, includes open, restore, read/write, MemTable flush, background compaction

  • Version Management: src/db/version_set.cc:728, manages MANIFEST, SST file levels, and compaction selection

  • Table Files/SSTable: src/table/table_builder.cc:1, src/table/table.cc:1

  • WAL Log: src/wal/log_writer.cc:1, src/wal/log_reader.cc:1

  • Utility Layer: Caching, encoding, CRC, Bloom filter, Env POSIX, etc., are in src/util

Build and Examples

CMakeLists.txt:1 will compile the static library rocketdb and build a simple interactive program db_test. The entry point is in main.cc:1, and the supported commands are:

put k1 v1 get k1 exit

About

RocketDB is a lightweight LSM-Tree based key-value database inspired by LevelDB, supporting WAL, MemTable, and SSTable storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages