Skip to content

Glyphack/redis-clone

Repository files navigation

My solution to "Build Your Own Redis" Challenge. This is a Redis clone that I built. It implements part of the Redis protocol (RESP 2) and supporting several commands.

Features

  • Basic Commands: GET, SET, PING
  • Concurrency: Supports multiple concurrent clients
  • Persistence: Loads RDB files and serves the content
  • Replication:
    • Performs replication handshake
    • Propagates commands to replicas
    • Supports the WAIT command for synchronization of replicas
  • Latency of GET and SET commands are similar to original Redis server! No libraries used.

Architecture

  • Uses an event loop
  • Runs on a single thread

Usage

make build
./build/redis

Send messages using redis-cli ping. Try other commands.

To run a replica run:

./build/redis --replicaof 6379

Technical Deep Dives

What I Learned

  • Network programming and protocol implementation
  • Async programming in C
  • Distributed systems concepts through replication
  • High-performance tcp server design
  • Implemented a hash map in C
  • Using my custom allocator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages