rosedblabs /rosedb
Lightweight, fast and reliable key/value storage engine based on Bitcask.
★ 4,888⑂ 642👁 39⑃ 185● 140▤ 19
+0
Daily
-2
Weekly
+3
Monthly
4,888
stars
642
forks
39
watchers
185
prs
140
issues
19
releases
README
English · 简体中文
What is ROSEDB
rosedb is a lightweight, fast and reliable key/value storage engine based on Bitcask storage model.
The design of Bitcask was inspired, in part, by log-structured filesystems and log file merging.
Status
rosedb is well tested and ready for production use. There are serveral projects using rosedb in production as a storage engine.
Didn't find the feature you want? Feel free to open an issue or PR, we are in active development.
Design overview
!
RoseDB log files are using the WAL(Write Ahead Log) as backend, which are append-only files with multiple blocks.
wal: https://github.com/rosedblabs/wal
Key features
Strengths
Low latency per item read or written
This is due to the write-once, append-only nature of Bitcask database files.
High throughput, especially when writing an incoming stream of random items
Write operations to RoseDB generally saturate I/O and disk bandwidth, which is a good thing from a performance perspective. This saturation occurs for two reasons: because (1) data that is written to RoseDB doesn't need to be ordered on disk, and (2) the log-structured design of Bitcask allows for minimal disk head movement during writes.
Ability to handle datasets larger than RAM without degradation
Access to data in RoseDB involves direct lookup from an in-memory index data structure. This makes finding data very efficient, even when datasets are very large.
Single seek to retrieve any value
RoseDB's in-memory index data structure of keys points directly to locations on disk where the data lives. RoseDB never uses more than one disk seek to read a value and sometimes even that isn't necessary due to filesystem caching done by the operating system.
Predictable lookup and insert performance
For the reasons listed above, read operations from RoseDB have fixed, predictable behavior. This is also true of writes to RoseDB because write operations require, at most, one seek to the end of the current open file followed by and append to that file.
Fast, bounded crash recovery
Crash recovery is easy and fast with RoseDB because RoseDB files are append only and write once. The only items that may be lost are partially written records at the tail of the last file that was opened for writes. Recovery operations need to review the record and verify CRC data to ensure that the data is consistent.
Easy Backup
In most systems, backup can be very complicated. RoseDB simplifies this process due to its append-only, write-once disk format. Any utility that archives or copies files in disk-block order will properly back up or copy a RoseDB database.
Batch options which guarantee atomicity, consistency, and durability
RoseDB supports batch operations which are atomic, consistent, and durable. The new writes in batch are cached in memory before committing. If the batch is committed successfully, all the writes in the batch will be peTop issues
#226Who is using RoseDB?3 comments · 2023-07-10#345`Merge(true)` replaces the synced data segments with merged files that were never fsynced; a power loss shortly after a merge leaves the database unopenable (`EOF`)1 comments · 2026-10-22#335Clarify memory semantics of the returned keys and values1 comments · 2025-11-15#289Proposal: allow key and value to store per bucket1 comments · 2023-10-03
Discussions
#320Key Value store in place of Redis1 comments · 2024-12-15#299Release v2.3.40 comments · 2024-01-07#286Release v2.3.30 comments · 2023-09-16#282Release v2.3.20 comments · 2023-08-30#281Release V2.3.20 comments · 2023-08-30#268Release v2.3.10 comments · 2023-08-21#260Release v2.3.00 comments · 2023-08-18#248Release v2.2.20 comments · 2023-08-05
Latest release
Release v2.4.0 v2.4.0 2025-02-21🚀 New Features Thans to @XiXi-2024 implement database iterator functionality (https://github.com/rosedblabs/rosedb/pull/326) 🎄 Enhancements Thanks to @miaozw Add AscendKeysRange and DescendKeysRange functions (https://github.com/rosedblabs/rosedb/pull/323) Thans to @XiXi-2024 Add unit tests for AscendKeysRange and DescendKeysRange methods (https://github.com/rosedblabs/rosedb/pull/324) 🐞 Bug Fixes Thanks to @auula fix: inner error bug in the delete expired key method. (https://github.com/rosedblabs/rosedb/pull/322)