A tutorial of building an LSM-Tree storage engine in a week! (WIP)

Overview

LSM in a Week

CI (main)

Build a simple key-value storage engine in a week!

Tutorial

The tutorial is available at https://skyzh.github.io/mini-lsm. You can use the provided starter code to kick off your project, and follow the tutorial to implement the LSM tree.

Development

cargo x install-tools
cargo x check
cargo x book

If you changed public API in the reference solution, you might also need to synchronize it to the starter crate. To do this, use cargo x sync.

Progress

The tutorial has 8 parts (which can be finished in 7 days):

  • Day 1: Block encoding. SSTs are composed of multiple data blocks. We will implement the block encoding.
  • Day 2: SST encoding.
  • Day 3: MemTable and Merge Iterators.
  • Day 4: Block cache and Engine. To reduce disk I/O and maximize performance, we will use moka-rs to build a block cache for the LSM tree. In this day we will get a functional (but not persistent) key-value engine with get, put, scan, delete API.
  • Day 5: Compaction. Now it's time to maintain a leveled structure for SSTs.
  • Day 6: Recovery. We will implement WAL and manifest so that the engine can recover after restart.
  • Day 7: Bloom filter and key compression. They are widely-used optimizations in LSM tree structures.

We have reference solution up to day 4 and tutorial up to day 4 for now.

You might also like...
LLVM tutorial in Rust language

Status Everything works. State corresponds to the Chapter 7 of the original tutorial (i.e. mutable variables implemented). TODO list. LLVM tutorial in

A comprehensive and FREE Online Rust hacking tutorial utilizing the x64, ARM64 and ARM32 architectures going step-by-step into the world of reverse engineering Rust from scratch.
A comprehensive and FREE Online Rust hacking tutorial utilizing the x64, ARM64 and ARM32 architectures going step-by-step into the world of reverse engineering Rust from scratch.

FREE Reverse Engineering Self-Study Course HERE Hacking Rust A comprehensive and FREE Online Rust hacking tutorial utilizing the x64, ARM64 and ARM32

High concurrency, RealTime, In-memory storage inspired by erlang mnesia
High concurrency, RealTime, In-memory storage inspired by erlang mnesia

DarkBird is a Document oriented, high concurrency in-memory Storage, also persist data to disk to avoid loss any data The darkbird provides the follow

A HashMap/Vector hybrid: efficient, ordered key-value data storage in Rust.

hashvec A HashVec is a hash map / dictionary whose key-value pairs are stored (and can be iterated over) in a fixed order, by default the order in whi

A simple local storage media library manager.
A simple local storage media library manager.

OFFFLIX A simple application to auto manage series on your local storage. Features Resume watching Play next episode Auto increment season Play random

Manas project aims to create a modular framework and ecosystem to create robust storage servers adhering to Solid protocol in rust.

मनस् | Manas Solid is a web native protocol to enable interoperable, read-write, collaborative, and decentralized web, truer to web's original vision.

A highly performant HTTP bittorrent tracker (WIP)

kiryuu Rewrite of kouko in Rust, for better performance! Kiryuu powers http://tracker.mywaifu.best:6969/announce Thanks Many thanks to horsie and anon

Symbolic EVM in Rust (WIP)

Ser Symbolic EVM in Rust Introduction Ser's design is informed by lessons I learned from a previous attempt to build a highly abstract & generalized s

Serialize & deserialize device tree binary using serde

serde_device_tree Use serde framework to deserialize Device Tree Blob binary files; no_std compatible. Use this library Run example: cargo run --examp

Comments
  • no such command: `nextest`

    no such command: `nextest`

    I got an error when using cargo x scheck to check the style and run all test cases according to Tutorial:

    cargo fmt
    cargo check
        Finished dev [unoptimized + debuginfo] target(s) in 0.04s
    cargo nextest run
    error: no such command: `nextest`
    
            Did you mean `test`?
    
            View all installed commands with `cargo --list`
    Error: command ["cargo", "nextest", "run"] exited with code 101
    

    after I replace nextest with test in test(), only style checking works, no test cases run.

    opened by rien7 1
Owner
Alex Chi
building database systems, @tikv maintainer, @risinglightdb maintainer, @cmu-db BusTub developer; a bubble tea every day makes me happy right away
Alex Chi
Try to learn Rust in a week. The goal is to finish a quiz at the end of the week.

RustInAWeek Try to learn Rust in a week. The goal is to finish the quiz at the end of the week. Quiz link https://dtolnay.github.io/rust-quiz/1 Book l

null 1 Dec 13, 2021
Key-value store for embedded systems, for raw NOR flash, using an LSM-Tree.

ekv Key-value store for embedded systems, for raw NOR flash, using an LSM-Tree. Features None yet TODO Everything Minimum supported Rust version (MSRV

Dario Nieuwenhuis 16 Nov 22, 2022
Ray Tracing: The Next Week implementation in Rust

rttnw Ray Tracing: The Next Week implementation in Rust How to run Install Rust: Link here. Run project git clone https://github.com/luliic2/rttnw cd

null 20 Apr 26, 2022
A Matrix bot which can generate "This Week in X" like blog posts

hebbot A Matrix bot which can help to generate periodic / recurrent summary blog posts (also known as "This Week in X"). The bot was inspired by twim-

Häcker Felix 43 Dec 17, 2022
This Repo Contains my Week Long Journey Trying to Learn Rust Programming Language 🦀.

the-rust-way This Repo Contains my Week Long Journey Trying to Learn Rust Programming Language ?? . ?? Thanks to all Wonderful Contributors Thanks a l

Kanishk Pachauri 7 Oct 20, 2022
Accompanying the 5-class, 1 class per week series of Ultimate Rust: Foundations

Ultimate Rust Foundations Presented by Ardan Labs, Ultima Rust: Foundations gives you a "zero to hero" class to get you started with Rust. You'll lear

Herbert 7 May 22, 2023
Raytracer tutorial for PPCA 2021, written in Rust.

Pseudo Photograph Company of ACM 工科和ACM的朋友们都已结课!看看这些了不起的艺术品: 工科 ACM ACM伪摄影公司,简称PPCA,于2021年成立 ?? 这个项目的主要工作是使用Rust语言实现一个光线追踪渲染器。以这个形式,你能通过学习一门新的(而且漂亮的)语

null 113 Dec 13, 2022
An RPC framework developing tutorial

Mini Lust 系列教程 好奇如何从零造出来一个 RPC 框架?本教程将带你一步一步写出来一个 Rust 版 Thrift RPC 框架。 教程说明 从第二章开始每章节都会附带代码。 这个代码是在上一章节的基础上写的,文档里一般会告诉你增加了哪些东西,但是如果你想详细地对比到底哪里变动了,可以自

null 454 Dec 30, 2022
Rust serenity korean tutorial

?? 러스트 Serenity 디스코드 API 강좌 반갑습니다. 러스트 Serenity 디스코드 API 강좌에 오신것을 진심으로 환영합니다 ! Serenity는 러스트로 짜여진 디스코드 API 입니다. 독자 여러분들은 discord.py 를 해보셨습니까? 만약, disc

Fn79 3 Dec 17, 2021
Tutorial for parsing with nom 5.

Nom Tutorial Nom is a wonderful parser combinators library written in Rust. It can handle binary and text files. Consider it where you would otherwise

Benjamin Kay 265 Dec 11, 2022