Skip to content

An in-memory key-value database following Redis Serialization Protocol (RESP) standard.

Notifications You must be signed in to change notification settings

Sheikh566/brownis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Brownis

Brownis is a lightweight Redis-compatible server implementation written in Go. It supports basic Redis commands and core functionality like the Redis Serialization Protocol (RESP) and replication.

Features

  • RESP Protocol: Full support for Redis Serialization Protocol for communication.
  • Key-Value Store: In-memory storage for strings with optional expiry.
  • Replication: Supports Master/Replica configuration with handshake and command propagation.
  • Multi-client support: Handles multiple concurrent client connections.

Supported Commands

  • PING: Check server availability.
  • ECHO: Returns the input string.
  • SET: Store a key-value pair. Supports PX for millisecond-level expiry.
  • GET: Retrieve the value of a key.
  • INFO: Get server information (replication role, IDs, etc.).

Getting Started

Prerequisites

  • Go 1.25 or higher

Running the Server

To start the server on the default port (6379):

go run app/*.go

To start on a custom port:

go run app/*.go --port 6380

To start as a replica of another server:

go run app/*.go --port 6381 --replicaof "127.0.0.1 6379"

Implementation Details

  • Concurrency: Each connection is handled in a separate goroutine.
  • Replication: Master nodes propagate SET commands to all connected replicas.
  • Expiry: Values stored with PX are automatically expired during GET requests.

About

An in-memory key-value database following Redis Serialization Protocol (RESP) standard.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages