Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eiri/py_bitcask
Fast Key/Value Data Storage
https://github.com/eiri/py_bitcask
bitcask educational-project
Last synced: 28 days ago
JSON representation
Fast Key/Value Data Storage
- Host: GitHub
- URL: https://github.com/eiri/py_bitcask
- Owner: eiri
- License: mit
- Created: 2024-02-05T02:34:31.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-28T02:17:08.000Z (8 months ago)
- Last Synced: 2024-03-28T04:30:02.060Z (8 months ago)
- Topics: bitcask, educational-project
- Language: Python
- Homepage: https://eiri.github.io/py_bitcask/
- Size: 123 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bitcask
[![tests](https://github.com/eiri/py_bitcask/actions/workflows/tests.yml/badge.svg)](https://github.com/eiri/py_bitcask/actions/workflows/tests.yml)A Log-Structured Hash Table for Fast Key/Value Data.
## Motivation
A short undertaking to refresh my knowledge of Python programming and serve as an educational endeavor.
## Bitcask Overview
Bitcask is a high-performance key-value store designed for efficiently storing and retrieving data on disk. It utilizes a log-structured storage mechanism that organizes data into an append-only log, providing fast write and read operations. In Bitcask, when a write operation occurs, Bitcask appends the new data to a write-ahead log and updates an in-memory hash table for quick access. Reads are performed by first checking the hash table for the location of the data file and then retrieving the data directly from disk, ensuring constant-time access regardless of database size.
Bitcask employs a merge process to periodically compact data files and reclaim disk space. During a merge, Bitcask iterates over immutable data files and produces a set of compacted files containing only the latest versions of each key. This process helps prevent disk fragmentation and optimizes storage utilization over time. Bitcask's simplicity, coupled with its efficient read and write operations, makes it well-suited for use cases requiring fast and reliable key-value storage.
## Whitepaper
[Bitcask: A Log-Structured Hash Table for Fast Key/Value Data](https://riak.com/assets/bitcask-intro.pdf)
## API
- open: directory
- get: key
- put: key, value
- list_keys
- fold: fun, acc
- merge
- sync
- close## License
[MIT](https://github.com/eiri/py_bitcask/blob/master/LICENSE)