Skip to content

A C-based project inspired by Redis, focused on building a key-value store with TCP client-server communication and basic data handling.

Notifications You must be signed in to change notification settings

havl-code/my-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

My Redis-Inspired Program

This project is inspired by the "Build Your Own Redis with C/C++" guide. It aims to break down and implement essential features of an in-memory key-value store.

Project Goals

  • Hands-on learning: Build an understanding of systems programming with C, focusing on socket communication, memory management, data structures, and efficient client-server protocols.
  • Feature staging: Develop in incremental stages to gradually introduce network protocols, command handling, and storage techniques

Current Featues

  1. TCP Server-Client Communication:

    • The server and client communicate using a structured message protocol, with each message prefixed by a 4-byte length header.
    • The server listens on a specified port, accepts multiple requests per client connection, and returns structured responses.
  2. Error Handling and Debugging:

    • Expanded error handling to manage socket errors, unexpected disconnections, and message size validations.
    • Helper functions provide consistent logging and error messages for ease of debugging.

Getting Started

Prerequisites

  • C Compiler: Required for building the code
  • Linux Environment: The project is currently developed on Linux for compatibility with networking libraries.

Cloning the Repository

git clone https://github.com/havl-code/my-redis.git
cd my-redis

Compilation and Running

  1. Compile the code:
gcc -o server server.c
gcc -o client client.c
  1. Run the server:
./server
  1. Run the client in a new terminal:
./client

The client will send a message to the server and receive a response.

Project Structure

  • server.c: Contains the server code with modular handling of client requests, structured message protocol, and multi-request capability per client connection.
  • client.c: Implements the client code with multiple requests to the server, modular query handling, and complete data transmission with helper functions.

Future Features (In Progress)

Resources

This project is based on concepts and code from the "Build Your Own Redis with C/C++" guide.

About

A C-based project inspired by Redis, focused on building a key-value store with TCP client-server communication and basic data handling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages