Skip to content

mrtonbrian/miniredis

Repository files navigation

miniredis

Build and Test codecov Go Report Card License

A mini version of Redis written in Go. Slightly faster than Redis in some situations. Not meant for production use.

Benchmark

Here is a mini benchmark on basic SET/GET commands that I ran on my laptop.

Actual Redis

No disk persistence

redis-server --port 6379 --appendonly no

Result:

brianton@brianlenlaptop:~$ redis-benchmark -p 6379 -t set,get -n 10000000 -q -P 512 -c 512
SET: 1704604.62 requests per second
GET: 2375965.00 requests per second

MiniRedis

No disk persistence

./miniredis.sh

Result:

brianton@brianlenlaptop:~$ redis-benchmark -p 6379 -t set,get -n 10000000 -q -P 512 -c 512
WARN: could not fetch server CONFIG
SET: 1723040.88 requests per second
GET: 5471556.00 requests per second

Speedup for GET is mostly due to concurrency, I believe (entire table is locked for SET, so not much speedup in that case). Could be improved with a sharded concurrent map library?

TODO list

  • Write some basic parser for RESP
  • Get an MVP of basic SET / GET functionality
  • Run initial redis-benchmark on SET / GET
  • Implement pipelining
  • Run another redis-benchmark
  • Match / beat redis on the basic SET / GET
  • Implement expiry
  • Implement RDB
  • Implement lists
  • Implement transactions
  • Move to IO_URING
  • Swap map library(?)
  • Implement pub/sub

About

A mini version of Redis written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published