Skip to content

buckfullingham/rkamindo-redis-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Server in C

This project is a lightweight Redis server implementation in C, created as part of the Coding Challenges project.

Features

  • RESP (REdis Serialization Protocol) implementation
  • Support for basic Redis commands (PING, ECHO, SET (no expiry options), GET)
  • GoogleTest for unit testing
  • Cmake for building

System Requirements

  • Linux operating system (or other Unix-like systems)
  • CMake (version 3.10 or higher)cmake
  • GCC or Clang compiler with C11 support

Build Instructions

This project uses CMake for building.

mkdir build
cmake -S . -B build
cmake --build build

Running the server

After building the project, you can run the server with the following command

./build/redis-lite

The server will start listening on port 6379 by default.

Once the server is running, you can use redis-cli to test various commands.

Start the redis-cli, and connect to the server.

redis-cli
127.0.0.1:6379> PING
PONG
127.0.0.1:6379> ECHO "Hello World"
"Hello World"
127.0.0.1:6379> SET Name Randy
OK
127.0.0.1:6379> GET Name
Randy
127.0.0.1:6379> SET Count 1
OK
127.0.0.1:6379> GET Count
1

Running Tests

After building the project, you can run the tests using CTest, CMake's testing tool. Follow these steps:

cd build
ctest

About

A lite Redis server built in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 84.0%
  • C++ 12.9%
  • CMake 3.1%