blob: 622011e40e901a357f5e4133e237cbbfd614bcf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# Redis Clone in Go
A lightweight, concurrent key-value store built from scratch in Go. This project implements the Redis protocol (RESP) and features custom sharding and a modular command system.
## Key Features
- **High Concurrency:** Uses data sharding to minimize lock contention.
- **RESP Protocol:** Fully compatible with standard tools like `redis-cli`.
- **Pub/Sub System:** Real-time message broadcasting for connected clients.
- **Modular Architecture:** Easy-to-extend command registry for adding new features.
## Quick Start
### 1. Run the Server
```bash
go run main.go
```
### 2. Connect with `redis-cli`
Open a new terminal window and run:
```bash
redis-cli
```
### 3. Try it out
```bash
> SET mykey "Hello Go"
OK
> GET mykey
"Hello Go"
> SUBSCRIBE news
```
## Project Structure
- `pkg/core`: Core data structures and protocol serialization.
- `pkg/commands`: The registry and logic for all commands.
- `pkg/pubsub`: Independent message hub for real-time communication.
---
_This project is a personal implementation built to learn Go concurrency and network programming._
|