add week 1 day 2 tutorial

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-21 11:56:09 +08:00
parent df35a954c9
commit 892e6ab8f7
11 changed files with 605 additions and 15 deletions

View File

@@ -149,7 +149,7 @@ Now that you have multiple memtables, you may modify your read path `get` functi
* Why doesn't the memtable provide a `delete` API?
* Is it possible to use other data structures as the memtable in LSM? What are the pros/cons of using the skiplist?
* Why do we need a combination of `state` and `state_lock`? Can we only use `state.read()` and `state.write()`?
* Why does the order to store and to probe the memtables matter?
* Why does the order to store and to probe the memtables matter? If a key appears in multiple memtables, which version should you return to the user?
* Is the memory layout of the memtable efficient / does it have good data locality? (Think of how `Byte` is implemented and stored in the skiplist...) What are the possible optimizations to make the memtable more efficient?
* So we are using `parking_lot` locks in this tutorial. Is its read-write lock a fair lock? What might happen to the readers trying to acquire the lock if there is one writer waiting for existing readers to stop?
* After freezing the memtable, is it possible that some threads still hold the old LSM state and wrote into these immutable memtables? How does your solution prevent it from happening?