Skip to content

codeHannan/Fluxeron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fluxeron Server

Description: Fluxeron Server is a Redis-Server clone designed to help developers understand the concepts of application logic and database management.

Features:

  • It provides a range of commands to interact with the database such as SET, GET, DEL, and others.
  • Implements support for list operations such as LPUSH, LPOP, and various hash operations.
  • Database dump and persistence functionalities.

Getting Started

Prerequisites

You need to have the following installed:

  • C++ compiler (with C++17 support)
  • Make utility

Building the Project

To compile the Fluxeron Server:

make all

This will create an executable named fluxeron_server.exe in the directory.


Running the Server

To run the server on the default port (6379):

make run

OR:

./fluxeron_server.exe

To specify a custom port:

./fluxeron_server.exe <custom-port>

List of Supported Commands

Common Commands:

  1. PING: Verifies connectivity to the server. Returns +PONG.
  2. ECHO <message>: Echoes the provided message. Returns +<message>.

Key-Value Operations:

  1. SET <key> <value>: Assigns a value to a key. Returns +OK.
  2. GET <key>: Retrieves the value of a key. Returns value or $-1.
  3. DEL <key>: Deletes the specified key. Returns the count of keys removed.
  4. EXPIRE <key> <seconds>: Sets a timeout for a key. Returns +OK if successful.
  5. RENAME <old-key> <new-key>: Renames a key. Returns +OK if successful.

List Operations:

  1. LPUSH <key> <value1> <value2> ...: Pushes values to the start of a list.
  2. RPUSH <key> <value1> <value2> ...: Pushes values to the end of a list.
  3. LLEN <key>: Returns the length of a list.
  4. LPOP <key>: Pops a value from the start of a list.
  5. RPOP <key>: Pops a value from the end of a list.
  6. LGET <key>: Retrieves all elements of a list.

Hash Operations:

  1. HSET <key> <field> <value>: Sets the value of a field in a hash.
  2. HGET <key> <field>: Gets the value of a field in a hash.
  3. HDEL <key> <field>: Deletes a field in a hash.
  4. HGETALL <key>: Gets all fields and values of a hash.

Additional Build Commands

  1. Clean Build:

    make clean
    

    This removes all generated files.

  2. Rebuild Everything:

    make rebuild
    

Persistence

The server periodically saves the database to a file named dump.my_fdb.

  • Interval: Every 300 seconds
  • Persistent methods notify the developer through the command line (success or error).

About

This project was a great hands-on learning experience, and I’d like to thank Selcuk Ata Aksoy (https://github.com/Cukowski) for his clear and insightful YouTube tutorial.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors