Giter VIP home page Giter VIP logo

redis-clone's Introduction

Redis Clone

This project is a simplified clone of Redis, supporting basic commands and using the Redis Serialization Protocol (RESP) for communication and Data persistence using Append Only File (AOF).

**This project is for educational purposes and not meant to be on production.**

Table of Contents

Overview

This Redis clone supports the following commands:

  • SET
  • GET
  • HSET
  • HGET
  • HGETALL
  • DEL
  • EXISTS

Installation

To install and run this project:

  1. Clone the repository:

    git clone https://github.com/MikhailWahib/redis-clone.git
    cd redis-clone
  2. Build the project:

    make build
  3. Run the server:

    make run

Usage

  1. Start your Redis clone server as shown above.
  2. Use the Redis CLI on the default port to interact with your server:
    redis-cli -h 127.0.0.1 -p 6379

Testing

To run the tests:

make test

Supported Commands

  • SET: Set a key to a string value.
    SET key value
  • GET: Get the value of a key.
    GET key
  • HSET: Set a field in a hash to a value.
    HSET hash field value
  • HGET: Get the value of a field in a hash.
    HGET hash field
  • HGETALL: Get all fields and values in a hash.
    HGETALL hash
  • DEL: Delete values with keys
    DEL key [key...]
  • EXISTS: Check if keys exist
    EXISTS key [key...]

Project Structure

  • main.go: Entry point of the application.
  • resp.go: Contains RESP parsing logic.
  • handler.go: Contains the implementations of supported commands handlers.
  • aof.go: Contains the logic of AOF.

redis-clone's People

Contributors

mikhailwahib avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.