Skip to content

SanskarMali726/Redis-server-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis-like Server in Go

This project is a simple Redis-like server implemented in Go.
It supports a few basic Redis commands and can be tested using the official redis-cli.exe client.


Author

Maintained by: SanskarMali726

Project Status

  • Experimental / Learning project
  • Not a full Redis replacement
  • Built to practice Go, server development, and RESP protocol

What You Will Learn

  • Go language
  • TCP server development
  • RESP protocol handling (Redis protocol)
  • Basic persistence with AOF
  • Client-server communication testing using redis-cli

License

This project is open source under the MIT License.

Features

  • Implements basic Redis commands:
    • PING
    • SET key value
    • GET key
    • DEL key
    • EXISTS key
  • Uses RESP (REdis Serialization Protocol) for communication
  • AOF (database.aof) persistence support

Prerequisites

Before running the server, make sure you have:

  • Go installed (1.20+ recommended)
  • Redis installed (for redis-cli client)

How to Run the Server

  1. Clone the repository: git clone https://github.com/SanskarMali726/Redis-server-go.git
  2. Run the Go server:
    go run .
    

By default, the server listens on: 127.0.0.1:6379

How to Connect with redis-cli

Open a terminal in your Redis installation folder (where redis-cli.exe is located).

Connect to your server:

redis-cli -h 127.0.0.1 -p 6379

Try out commands:

127.0.0.1:6379> PING PONG

127.0.0.1:6379> SET language Go OK

127.0.0.1:6379> GET language "Go"

127.0.0.1:6379> SET framework "Chi Router" OK

127.0.0.1:6379> GET framework "Chi Router"

127.0.0.1:6379> DEL framework (integer) 1

127.0.0.1:6379> GET framework (nil)


About

My custom Redis-like server implemented in Go with support for a few commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages