Crates.io | crabdis |
lib.rs | crabdis |
version | 0.1.23 |
created_at | 2024-03-11 00:58:09.777959+00 |
updated_at | 2025-06-19 12:57:54.550421+00 |
description | It's like Redis but a bit rusty... |
homepage | https://github.com/pxseu/crabdis#readme |
repository | https://github.com/pxseu/crabdis |
max_upload_size | |
id | 1169073 |
size | 137,543 |
It's like Redis but a bit rusty...
This is a simple in-memory key-value store written in Rust. It's somewhat compatible with Redis via the RESP protocol, but it's not a drop-in replacement. A lot of commands are missing and stuff might not work as expected.
Please don't use this in production. Or do, I'm not your mom. But don't blame me if it eats your data.
I wanted to write Redis but multi-threaded and in Rust. This is the result. Works? Kinda. Is it good? Maybe. Is it fast? Yes.
You can find binaries on the releases page. Or you can build it yourself with cargo build --release
.
If you want to install it with cargo, you can do so with cargo install crabdis
.
There is also a Docker image available on Docker Hub.
crabdis
This will start the server on 127.0.0.1:6379
. You can change the address and port with the --address
and --port
flags.
Below are micro-benchmarks for core Value operations and RESP serialization/deserialization (run with cargo bench
).
File | Operation | Time (ns) |
---|---|---|
value_benchmarks.rs | create_string | 16.15 |
create_integer | 2.14 | |
create_multi | 54.0 | |
create_map | 105.3 | |
is_some | 0.581 | |
is_none | 0.443 | |
inner | 20.0 | |
value_resp2_benchmarks.rs | resp2_serialize_string | 161 |
resp2_serialize_integer | 102 | |
resp2_serialize_nil | 54 | |
resp2_serialize_multi | 511 | |
resp2_serialize_map | 844 | |
resp2_serialize_expire | 97 | |
resp2_deserialize_string | 294 | |
resp2_deserialize_integer | 228 | |
resp2_deserialize_nil | 232 | |
resp2_deserialize_multi | 598 | |
value_resp3_benchmarks.rs | resp3_serialize_map | 805 |
resp3_serialize_set | 503 | |
resp3_serialize_push | 591 | |
resp3_serialize_error | 188 | |
resp3_deserialize_map | 826 | |
resp3_deserialize_set | 532 | |
resp3_deserialize_push | 568 | |
resp3_deserialize_error | 269 |
Total (sum of all measured times): ≈ 7602 ns
(Lower is better. All times are approximate and measured on a Mac, see benches/ for details.)
This project is licensed under the MIT License.