https://github.com/farbodahm/codecrafters-redis-go
My solution to "Build Your Own Redis" Challenge.
https://github.com/farbodahm/codecrafters-redis-go
codecrafters codecrafters-redis redis
Last synced: about 1 month ago
JSON representation
My solution to "Build Your Own Redis" Challenge.
- Host: GitHub
- URL: https://github.com/farbodahm/codecrafters-redis-go
- Owner: farbodahm
- Created: 2025-01-20T20:03:28.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-02-04T21:27:49.000Z (4 months ago)
- Last Synced: 2025-03-30T23:44:31.483Z (2 months ago)
- Topics: codecrafters, codecrafters-redis, redis
- Language: Go
- Homepage:
- Size: 77.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://app.codecrafters.io/users/codecrafters-bot?r=2qF)
My approach to the ['Build Your Own Redis'](https://app.codecrafters.io/courses/redis/) challenge.
## Features
- **Basic Commands**:
- `GET`
- `SET` (with TTL)
- `PING`
- `ECHO`
- **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
- **Streams**:
- Create streams
- Support `XREAD` and `XRANGE` commands
- Support blocking reads (`XREAD block`)
- Support different type of queries (with `+`, `-`, `$`, partially/fully create IDs)
- **Transactions**:
- `INCR` command
- `MULTI` and `EXEC` commands
- Multiple concurrent transactions with failures within transactions## RUN
- **Build**:
- `go build -o redis app/*.go`
- **Basic execution**:
- `./redis --port 5678`
- **Parse RDB**:
- `./redis --dir ./redis-data/ --dbfilename dump.rdb --port 5678`
- **Run as replica**:
- `./redis --port 1234 --replicaof "localhost 6379"`
After the server is running, you can connect to it via any Redis client, Including `redis-cli`;
Ex: `redis-cli xread block 10000 streams orange 0-110`.**NOTE**: The current version fully supports RESP V2.