GithubHelp home page GithubHelp logo

r_wisckey's Introduction

r_wisckey

rust 实现基于 基本的log(区别于传统的关系型数据库的page存储)存储的kv存储引擎。

rust 版本:1.57.0。建议开发者升级最新。

目前最新可用版本:base_log_0.3.0

示例:

服务启动:

cargo run --bin wisc_server

客户端命令启动:

cargo run --bin wisc_client

命令行:

wisc-db>> get 桐人;

delete insert update 类似。

==============================================================

base_log 版本,我们实现了基本的基于日志的键值存储,但它并不是日志存储的惯用成熟方案。

相对,日志存储的常见数据布局是LSM-tree ,它的基本**是将数据在内存中排序,然后顺序持久化到磁盘。

在接下来的后续中后台线程不断压缩磁盘中的数据文件,去除无效数据。

详细的相关资料可查看相关的一些论文或者参考levelDB 的wiki。

大概的操作流程

1.写WAL LOG

2.更新内存:MemTable

3.当MemTable size 达到一定程度的时候。把Memtable变成不可变的内存块。 把这个不可变的内存块与磁盘上的SSTable文件进行合并,释放对应的 log 文件。

4.磁盘上的SSTable根据新旧先后分层。总是上面一层的与下面一层的合并。

5.读的时候先查MemTable,没有的时候,再顺次从Level-0~Level-N里面的SSTable 中查找。

最基础也是最重要的模块:LogMemTableImuTableSSTable。请务必理解他们之间的数据流转过程。

levelDB中还有两个文件:CURRENT, Manifest

CURRENT: 中记录所有level中每个SSTable 的key range和一些其它元数据,它以日志格式存储,记录所有sst文件的修改记录。

Manifest: 记录当前的manifest文件名。

current versionbase_lsm_0.1.0:LSM。

待更新。。。

======================================================================

log:

r_wisckey's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.