Start from talentplan rust practice course, continue developing for better performance. talent-plan/lesson-plan.md
A simple KV DB implemented in rust. The main project is in folder pakv_kernel.
-
bitcast mode. (index by mem, store by log)
- Advantages: Because using log for each time store, it is fast.
- Disadvantages: Indexes in memory, so there's a limit of capacity.
-
sync log append, no risk of losing data.
-
async, user-first compress
-
In bitcast mode, sync compact is impractical (compressing time might be too long), so I used a thread to compact
-
The user has higher priority, compressing thread will check user reach when some data are written, if user is reaching, compressing thread will stop compact.
-
Compress thread checks in a low frequency.
-
Compress threshold is dynamic
For example: first time compress threshold is 10, after compressing we get 5, the next compress threshold should be 5*N
Here we set N=2;
-
- bufferpool to speed up get.
- muti store engine(lsm)
Practical Networked Applications in Rust
pakv Project 1: The Rust toolbox
pakv Project 2: Log-structured file I/O
pakv Project 3: Synchronous client-server networking