Skip to content

A complete Redis clone implementing RESP protocol, Distributed clustering and Streaming.

License

Notifications You must be signed in to change notification settings

BenMeehan/Redis-clone

Repository files navigation

Redis Server Clone

This is a simple implementation of a Redis server in Go. It supports basic commands such as PING, ECHO, SET, and GET, along with the ability to set key expiry using the PX argument to the SET command.

This project was done as a part of CodeCrafters Build Your Own Redis Challenge.

Prerequisites

  • Go (Golang) installed on your machine
  • Basic knowledge of the Redis protocol (RESP)

Usage

  1. Clone the repository:

    git clone https://github.com/BenMeehan/Redis-clone.git
  2. Navigate to the project directory:

    cd Redis-clone
  3. Build the executable:

    go build
  4. Run the server:

    ./server
  5. Connect to the server using a Redis client (e.g., redis-cli) and start issuing commands:

    redis-cli

    Example commands:

    set mykey myvalue px 1000
    get mykey

Supported Commands

  • PING: Responds with PONG to indicate that the server is running.
  • ECHO: Echoes back the provided argument.
  • SET: Sets a key to a value. Supports optional expiry using the PX argument.
  • GET: Retrieves the value of a key. Handles key expiry automatically.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A complete Redis clone implementing RESP protocol, Distributed clustering and Streaming.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published