Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16 from yangyang233333/sst_reader
Browse files Browse the repository at this point in the history
修改README
  • Loading branch information
yangyang233333 authored Feb 4, 2023
2 parents 4d5dd5d + 548d7f0 commit 0e502a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ smallkv 是一个列存的、基于LSM架构的存储引擎。
---

## 客户端演示

基本操作类似Redis,如下图所示:
![cli](./img/client_demo.png)

Expand Down Expand Up @@ -115,7 +116,15 @@ IndexBlock存储对应的DataBlock中的最大key信息(注意:实际存储

![footer_schema](./img/footer_schema.png)
MetaBlock_OffsetInfo记录了MetaBlock的size和offset,IndexBlock_OffsetInfo记录了IndexBlock的offset(第一个IndexBlock的offset)和size(所有IndexBlock的总大小)。


### 4. **Read/Write Op**
![rw_op](img/rw_op.png)
- #### 4.1 Read
先读缓存, 有则立即返回; 否则读memtable, 有则立即返回; 否则使用SST Parser解析磁盘的SST文件,找到对应的key.

- #### 4.2 Write
先写wal, 保证数据安全; 在写memtable和cache.

---

## 第三方依赖:
Expand All @@ -132,11 +141,9 @@ MetaBlock_OffsetInfo记录了MetaBlock的size和offset,IndexBlock_OffsetInfo
1. [阿里云NewSQL数据库大赛](https://tianchi.aliyun.com/competition/entrance/531980/introduction)
2. [corekv](https://github.com/hardcore-os/coreKV-CPP)
3. [leveldb](https://github.com/google/leveldb)
4. [LSM树原理](https://zhuanlan.zhihu.com/p/181498475)
5. [LSM Tree是什么?](https://www.zhihu.com/question/446544471/answer/2348883977)
6. [WAL](https://zhuanlan.zhihu.com/p/258091002)
7. [Linux I/O: fsync, fflush, fwrite, mmap](https://juejin.cn/post/7001665675907301412)
4. [Linux I/O: fsync, fflush, fwrite, mmap](https://juejin.cn/post/7001665675907301412)

---

Thanks to [JetBrains](https://jb.gg/OpenSourceSupport) for donating product licenses to help develop **smallkv** <a href="https://jb.gg/OpenSourceSupport"><img src="img/jb_beam.svg" width="94" align="center" /></a>

Thanks to [JetBrains](https://jb.gg/OpenSourceSupport) for donating product licenses to help develop **smallkv
** <a href="https://jb.gg/OpenSourceSupport"><img src="img/jb_beam.svg" width="94" align="center" /></a>
Binary file added img/rw_op.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0e502a8

Please sign in to comment.