https://github.com/yiransheng/rust-toy-redis
Learning project, try to write a functioning redis-server for some basic commands
https://github.com/yiransheng/rust-toy-redis
key-value key-value-store redis redis-protocol rust tokio
Last synced: 2 months ago
JSON representation
Learning project, try to write a functioning redis-server for some basic commands
- Host: GitHub
- URL: https://github.com/yiransheng/rust-toy-redis
- Owner: yiransheng
- Created: 2018-04-05T01:28:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-17T05:05:41.000Z (about 7 years ago)
- Last Synced: 2025-01-26T11:28:57.637Z (4 months ago)
- Topics: key-value, key-value-store, redis, redis-protocol, rust, tokio
- Language: Rust
- Homepage:
- Size: 136 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rusty-toy-redis
A Learning project to write a redis server.
See [PLANS.md](./PLANS.md) for ideas I wanted to try.
See [CHECKPOINT.md](./CHECKPOINT.md) for current status of the code.
## Supported Commands
Only `SET`, `GET` and `DEL`
## Networking Protocol
Full RESP protocol is implemented, should be able to fool `redis-cli`
## Benchmark
```
#> redis-benchmark -t set,get -n 100000 -q# On my computer
#> SET: 149476.83 requests per second
#> GET: 153374.23 requests per second
```Rust is pretty amazing, achieving this level of performance for some beginner-level code.
For comparison, same benchmark run on actual `redis` server:
```
#> SET: 162337.66 requests per second
#> GET: 165289.25 requests per second
```(A naive version that handles each connection with a new thread I had [previously](https://github.com/yiransheng/rust-toy-redis/tree/0.1.1) completely choked on 100000 connection benchmark above; Yeah, tokio..)
Also run the same benchmark on `simpledb`, a python based redis compatible [key-value server](https://github.com/coleifer/simpledb); for a sense of how much low level languages matter in terms of perf:
```
#> SET: 25374.27 requests per second
#> GET: 28129.39 requests per second
```