https://github.com/biningo/bitcask-go
This is bitcask model db demo.
https://github.com/biningo/bitcask-go
Last synced: 2 months ago
JSON representation
This is bitcask model db demo.
- Host: GitHub
- URL: https://github.com/biningo/bitcask-go
- Owner: biningo
- Created: 2021-11-17T09:56:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T07:45:50.000Z (over 3 years ago)
- Last Synced: 2025-01-26T13:43:46.304Z (4 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Bitcask demo
redis是纯内存模型的,把kv数据都保存在内存中,但是一旦数据量很大的话就会占用大量内存 ,所以为了节省内存我们可以把value保存在磁盘里,在内存中只保存key和数据在磁盘对应的offset,读取的话则需要读两次: 先从内存读key对应的offset,再工具offset读一次磁盘即可获取数据。由于增删查改都是顺序IO,只需要不定期的进行merge文件,所以读写磁盘的速度还是挺快的。
references: https://github.com/roseduan/minidb