1 unstable release
new 0.2.1 | Apr 28, 2025 |
---|
#8 in #bitcask
130KB
3.5K
SLoC
Flash-KV
An efficient key-value storage engine, designed for fast reading and writing, which is inspired by Bitcask.
See Introduction, Installation and Usages for more details.
Introduction
Flash-KV is a high-performance key-value storage system written in Rust. It leverages a log-structured design with an append-only write approach to deliver exceptional speed, reliability, and scalability.
Features
- Efficient Key-Value Storage: Optimized for fast read and write operations with minimal overhead.
- Diverse Index: Support BTree, Skiplist, BPlusTree index for multiple index strategies.
- MemMap files for efficient I/O: To achieve rapid index reconstruction and enhance startup speeds
- Low latency per item read or written: Benchmarks run on a Macintosh with Apple M1 Core:
- Write latency:
~ 3.3 µs
- Read latency:
~ 370 ns
- Write latency:
- Concurrency Support: fine-grained locking minimizes contentions.
- WriteBatch transaction: commit a batch of writes to ensure atomicity.
Installation
To use flash-kv in your project, add it as a dependency in your Cargo.toml file:
[dependencies]
flash-kv = "0.2.1"
Then, run cargo build to download and compile flash-kv and its dependencies.
For more detailed setup and compilation instructions, visit the Flash-KV GitHub repository.
Usages
Please see examples
.
For detailed usage and API documentation, refer to the flash-kv Documentation.
TODO
- Basic error handling
- Merge files during compaction
- Configurable compaction triggers and thresholds
- WriteBactch transaction
- Use mmap to read data file that on disk.
- Optimize hintfile storage structure to support the memtable build faster
- Http api server
- Tests
- Benchmark
- Documentation
- Increased use of flatbuffers option to support faster reading speed
- Extend support for Redis Data Types
Contribution
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please raise an issue or submit a pull request.
License
Flash-KV is licensed under the [MIT license](https://github.com/KevinZh0C/FlashKV-rs/blob/main/LICENSE-MIT), permitting use in both open source and private projects.This license grants you the freedom to use flash-kv in your own projects, under the condition that the original license and copyright notice are included with any substantial portions of the Flash-KV software.
Dependencies
~7–16MB
~225K SLoC