Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.22 KB

README.md

File metadata and controls

42 lines (32 loc) · 1.22 KB

redis-server

Redis is an in-memory key-value NoSQL database.

This is a coding challenge from https://codingchallenges.fyi/challenges/challenge-redis/.
It aims to build a lite version of Redis with all the functionality of the first version of Redis.

The server was built using Python (but prefer C, Rust or Golang for performance) and test-driven development approach.

Run server : python redis_server.py

1 - protocol

  • RESP is the protocol used to communicate with a Redis server
  • Clients send commands to a Redis Server as a RESP Array of Bulk Strings
  • Server replies with one of the RESP type
  • Need to implement a functionality to serialize and deserialize messages

2 - server

  • Create a server that listens on port 6379
  • Sockets, Threads, Concurrency
  • Use redis-cli to communicate with redis server

3 - commands

  • PING
  • ECHO
  • SET (with expiration options)
  • GET
  • EXISTS
  • DEL
  • INCR
  • DECR
  • LPUSH
  • RPUSH
  • SAVE

4 - performance check

  • You can use redis-benchmark to check concurrency and performance
  • The redis-benchmark utility simulates running commands done by N clients while at the same time sending M total queries.

Tips

I use https://try.redis.io/ to compare my lite version with Redis