Skip to content

Implementation of data structure store like Redis. Using event loop design pattern for asynchronous tasks handling , RESP protocol, RDB file format loading and saving, and in-memory storage.

Notifications You must be signed in to change notification settings

rasadov/Redis-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Clone

Functionality

Notes:

  • In the example below I am using redis-cli and regular strings to simply explain logic. In the app itself the RESP protocol is being used for communication
  • Redis command names are case-insensitive, so ECHO, echo and EcHo are all valid commands.
  1. PING - for checking health. Supposed to return "PONG" as response
  $ redis-cli PING
  PONG
  1. ECHO - returns same message that was sent
  $ redis-cli echo message
  message
  • Note: if echo receives more than one word it will return an error
  $ redis-cli echo some message 
  Wrong number of arguments for 'ECHO' command
  1. SET - command used to set a key to a value. Can accept px argument which is a keyword for expiry. The value is passed of expire is passed in milliseconds
  $ redis-cli set foo bar 

Or set expiration to be 100 milliseconds

  $ redis-cli set foo bar px 100 
  1. GET - command used for getting a value with key. Returns null bulk string in case if it's not set or expired
  $ redis-cli set foo bar
  $ redis-cli get foo
  bar

About

Implementation of data structure store like Redis. Using event loop design pattern for asynchronous tasks handling , RESP protocol, RDB file format loading and saving, and in-memory storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published