Skip to content
FgrtuePublic

About

This is my implementation of Redis Server

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Redis

This is my implementation of Redis Server

How to build?

  • Requires CMake version 3.9.1 or later.
  • Contains server and the client.
  1. Get into folder that you want to build cd Server OR cd Client
  2. Create directory for build and cd there. mkdir build && cd build
  3. Call cmake .. with -DCMAKE_BUILD_TYPE=Release or -DCMAKE_BUILD_TYPE=Debug depending on the mode for build cmake .. -DCMAKE_BUILD_TYPE=Release
  4. Call cmake --build .
  5. In the /bin folder you will find the executable

What's inside?

  1. Redis server that supports commands
    • SET <key> <value=double>
      • Sets the key key with value value
    • GET <key>
      • Gets the value of key key
    • DEL <key>
      • Deletes the key key
    • RANGE <key> <score=double> <offset=int64> <limit=int64>
      • Get up to limit the keys in increasing order starting from key' with value val', which is offset from key with value score by offset elements
    • EXPIRE <key> <time=int64>
      • Set the expiration time of key key to time time
    • TTL <key>
      • Gets the expiration time of key key
  2. Client tests these features. In the main.cpp, some tests are presented that can be taken as an example.

Observe that the port used by the Server is 23'232. The IP address is the same as the address of the machine where it is run.

Interesting technical details

I explain briefly, what is peculiar about my implementation in terms of the concepts that were used.

  • Implementation using bare TCP sockets
  • Event-driven server using epoll
  • Data Structures implemented by hands to increase performance
    • Hash Map
    • AVL tree
    • Heap
    • Linked List
  • Implementation of timers for using the server as cache

About

This is my implementation of Redis Server

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages