Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ananth-swamy/redis-from-scratch
A simple redis server built from scratch
https://github.com/ananth-swamy/redis-from-scratch
from-scratch go golang inmemory-db nosql nosql-database redis redis-server
Last synced: 1 day ago
JSON representation
A simple redis server built from scratch
- Host: GitHub
- URL: https://github.com/ananth-swamy/redis-from-scratch
- Owner: ANANTH-SWAMY
- Created: 2025-01-09T17:23:21.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2025-01-16T12:54:20.000Z (26 days ago)
- Last Synced: 2025-01-16T14:19:21.744Z (26 days ago)
- Topics: from-scratch, go, golang, inmemory-db, nosql, nosql-database, redis, redis-server
- Language: Go
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Redis from scratch
A stripped down redis-server clone written as a hobby project. It is not intended to be used in production. No external dependencies were used for development.## Prequisites
Have Go installed.## Usage
- Clone the repo
- Run by executing
```
go run .
```
- Or build and run using
```
go build . && ./redis
```
- Connect to the server with any redis client. For example, `redis-cli`. The server listens on port `6379` by default.
```
$ redis-cli
```## Supported commands
- PING
- SET
- GET
- DEL
- MSET
- MGET
- HSET
- HGET
- HDEL
- EXISTS
- HEXISTS## Persistence
The `encoding/gob` package is used to asynchronously create a dump of the store in a binary file called `dump.rdb` every one second. This `dump.rdb` file is used to restore the data when then server is restarted in the same directory.