Skip to content

Latest commit

 

History

History
90 lines (71 loc) · 1.45 KB

README.md

File metadata and controls

90 lines (71 loc) · 1.45 KB

MyRedis

My simple Redis data structure store powered by myasync. RESP2 compatible. Supports redis-cli.

Implemented:

  • Replicas
  • Append-only snapshots
  • Ping
  • Echo
  • Get
  • Set (with expire)
  • Get config values

Setup

  • Create venv
python -m venv .venv 
  • Activate venv
. .venv/bin/activate 
  • Install myredis
pip install myredis@git+https://github.com/KrySeyt/myredis.git
  • Run myredis server
python -m myredis

Configuration

  • --port <port:int> - Optional. Server port. Default - 6379
  • --dir <dirname:str> - Optional. DB files dir.
  • --dbfilename <filename:str> - Optional. DB filename.
  • --snapshotsinterval <seconds:int> - Optional. Interval between snapshot updates. Default - 300 secs (5 mins)
  • --replicaof <master-domain:str> <master-port:int> - Optional. Start server as replica of master
python -m myredis --port 6379 --dir mydir --dbfilename dbfile

Supported commands

redis-cli get foo
redis-cli set foo bar
redis-cli set foo bar px 1000
redis-cli wait 3 1000
redis-cli ping
redis-cli echo "Hello, World\!"
redis-cli wait 3 1000
redis-cli config get port

Supported data types

  • String
  • Integer (server responses only)
  • Null (server responses only)

Tests

  • Complete Setup

  • Run tests

pytest