Skip to content

Commit

Permalink
relicense mini-lsm-book to CC BY-NC-SA 4.0 (#118)
Browse files Browse the repository at this point in the history
* relicense mini-lsm-book to CC BY-NC-SA 4.0

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>

* clearify license

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>

* fix fmt

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>

* fix fmt

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>

---------

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>
  • Loading branch information
skyzh authored Jan 20, 2025
1 parent d9d1281 commit 7f4b204
Show file tree
Hide file tree
Showing 152 changed files with 2,105 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .licensesnip
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2022-%YEAR% Alex Chi Z

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ We have 3 weeks + 1 extra week (in progress) for this tutorial.
* Week 1: Storage Format + Engine Skeleton
* Week 2: Compaction and Persistence
* Week 3: Multi-Version Concurrency Control
* The Extra Week / Rest of Your Life: Optimizations (unlikely to be available in 2024...)
* The Extra Week / Rest of Your Life: Optimizations (unlikely to be available in 2025...)

![Tutorial Roadmap](./mini-lsm-book/src/lsm-tutorial/00-full-overview.svg)

Expand Down
8 changes: 8 additions & 0 deletions licensesnip.config.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"use_gitignore": true,
"file_types": {
"rs": {
"before_line": "// "
}
}
}
1 change: 1 addition & 0 deletions mini-lsm-book/.licensesnip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
437 changes: 437 additions & 0 deletions mini-lsm-book/LICENSE

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions mini-lsm-book/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# mini-lsm-book

The mini-lsm course in mdbook. This part of the repo is licensed under CC BY-NC-SA 4.0.
2 changes: 1 addition & 1 deletion mini-lsm-book/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
text-align: center;
font-size: smaller;
color: gray;
}
}
10 changes: 10 additions & 0 deletions mini-lsm-book/licensesnip.config.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"use_gitignore": true,
"file_types": {
"md": {
"before_block": "<!--",
"before_line": " ",
"after_block": "-->"
}
}
}
4 changes: 4 additions & 0 deletions mini-lsm-book/src/00-get-started.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Environment Setup

The starter code and reference solution is available at [https://github.com/skyzh/mini-lsm](https://github.com/skyzh/mini-lsm).
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/00-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Mini-LSM Course Overview

## Tutorial Structure
Expand Down
6 changes: 5 additions & 1 deletion mini-lsm-book/src/00-preface.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Preface

![Banner](./mini-lsm-logo.png)
Expand Down Expand Up @@ -64,7 +68,7 @@ The long story of why we rewrote it: The tutorial was originally planned as a ge

### License

The source code of this course is licensed under Apache 2.0, while the author owns the complete copyright of the tutorial itself (markdown files + figures).
The source code of this course is licensed under Apache 2.0, while the book is licensed under CC BY-NC-SA 4.0.

### Will this tutorial be free forever?

Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/00-v1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Mini-LSM v1

This is a legacy version of the Mini-LSM tutorial and we will not maintain it anymore. We now have a new version of this tutorial. We keep the legacy version in this book so that the search engine can keep the pages in the index and users can follow the links to the new version of the tutorial.
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/01-block.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Block Builder and Block Iterator

<div class="warning">
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/02-sst.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# SST Builder and SST Iterator

<div class="warning">
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/03-memtable.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Mem Table and Merge Iterators

<div class="warning">
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/04-engine.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Storage Engine and Block Cache

<div class="warning">
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/05-compaction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Leveled Compaction


Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/06-recovery.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Write-Ahead Log for Recovery

<div class="warning">
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/07-bloom-filter.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Bloom Filters


Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/08-key-compression.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Key Compression

<div class="warning">
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/09-whats-next.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# What's Next

We did not finish this chapter as part of Mini-LSM v1.
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# LSM in a Week

[Preface](./00-preface.md)
Expand Down
6 changes: 5 additions & 1 deletion mini-lsm-book/src/copyright.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<p style="text-align: center; margin-top: 3em"><small>Your feedback is greatly appreciated. Welcome to join our <a href="https://skyzh.dev/join/discord">Discord Community</a>.<br>Found an issue? Create an issue / pull request on <a href="https://github.com/skyzh/mini-lsm">github.com/skyzh/mini-lsm</a>.<br>Copyright © 2022 - 2024 Alex Chi Z. All Rights Reserved.</small></p>
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

<p style="text-align: center; margin-top: 3em"><small>Your feedback is greatly appreciated. Welcome to join our <a href="https://skyzh.dev/join/discord">Discord Community</a>.<br>Found an issue? Create an issue / pull request on <a href="https://github.com/skyzh/mini-lsm">github.com/skyzh/mini-lsm</a>.<br>mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0.</small></p>
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-01-memtable.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Memtables

![Chapter Overview](./lsm-tutorial/week1-01-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-02-merge-iterator.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Merge Iterator

![Chapter Overview](./lsm-tutorial/week1-02-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-03-block.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Block

![Chapter Overview](./lsm-tutorial/week1-03-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-04-sst.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Sorted String Table (SST)

![Chapter Overview](./lsm-tutorial/week1-04-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-05-read-path.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Read Path

![Chapter Overview](./lsm-tutorial/week1-05-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-06-write-path.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Write Path

![Chapter Overview](./lsm-tutorial/week1-05-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-07-sst-optimizations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Snack Time: SST Optimizations

![Chapter Overview](./lsm-tutorial/week1-07-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week1-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Week 1 Overview: Mini-LSM

![Chapter Overview](./lsm-tutorial/week1-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-01-compaction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Compaction Implementation

![Chapter Overview](./lsm-tutorial/week2-01-full.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-02-simple.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Simple Compaction Strategy

![Chapter Overview](./lsm-tutorial/week2-02-simple.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-03-tiered.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Tiered Compaction Strategy

![Chapter Overview](./lsm-tutorial/week2-00-tiered.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-04-leveled.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Leveled Compaction Strategy

![Chapter Overview](./lsm-tutorial/week2-04-leveled.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-05-manifest.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Manifest

![Chapter Overview](./lsm-tutorial/week2-05-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-06-wal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Write-Ahead Log (WAL)

![Chapter Overview](./lsm-tutorial/week2-06-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-07-snacks.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Batch Write and Checksums

<!-- ![Chapter Overview](./lsm-tutorial/week2-07-overview.svg) -->
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week2-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Week 2 Overview: Compaction and Persistence

![Chapter Overview](./lsm-tutorial/week2-overview.svg)
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-01-ts-key-refactor.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Timestamp Key Encoding + Refactor

In this chapter, you will:
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-02-snapshot-read-part-1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Snapshot Read - Memtables and Timestamps

In this chapter, you will:
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-03-snapshot-read-part-2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Snapshot Read - Engine Read Path and Transaction API

In this chapter, you will:
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-04-watermark.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Watermark and Garbage Collection

In this chapter, you will implement necessary structures to track the lowest read timestamp being used by the user, and collect unused versions from SSTs when doing the compaction.
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-05-txn-occ.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Transaction and Optimistic Concurrency Control

In this chapter, you will implement all interfaces of `Transaction`. Your implementation will maintain a private workspace for modifications inside a transaction, and commit them in batch, so that all modifications within the transaction will only be visible to the transaction itself until commit. We only check for conflicts (i.e., serializable conflicts) when commit, and this is optimistic concurrency control.
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-06-serializable.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# (A Partial) Serializable Snapshot Isolation

Now, we are going to add a conflict detection algorithm at the transaction commit time, so as to make the engine to have some level of serializable.
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-07-compaction-filter.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Snack Time: Compaction Filters

Congratulations! You made it there! In the previous chapter, you made your LSM engine multi-version capable, and the users can use transaction APIs to interact with your storage engine. At the end of this week, we will implement some easy but important features of the storage engine. Welcome to Mini-LSM's week 3 snack time!
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week3-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# Week 3 Overview: Multi-Version Concurrency Control

In this part, you will implement MVCC over the LSM engine that you have built in the previous two weeks. We will add timestamp encoding in the keys to maintain multiple versions of a key, and change some part of the engine to ensure old data are either retained or garbage-collected based on whether there are users reading an old version.
Expand Down
4 changes: 4 additions & 0 deletions mini-lsm-book/src/week4-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
mini-lsm-book © 2022-2025 by Alex Chi Z is licensed under CC BY-NC-SA 4.0
-->

# The Rest of Your Life (TBD)

This is an advanced part that deep dives into optimizations and applications of the LSM storage engine and will make your implementation more production-ready. We are still planning on the content, and this part will not be publicly available in near future.
Expand Down
Loading

0 comments on commit 7f4b204

Please sign in to comment.