https://github.com/ashwaniydv/redis-server-clone-js
A very simple redis-server clone built using nodejs. It uses RESP (REdis Serialization Protocol) to communicate with clients. You can use any official redis client to talk to this server.
https://github.com/ashwaniydv/redis-server-clone-js
redis resp tcp
Last synced: 4 months ago
JSON representation
A very simple redis-server clone built using nodejs. It uses RESP (REdis Serialization Protocol) to communicate with clients. You can use any official redis client to talk to this server.
- Host: GitHub
- URL: https://github.com/ashwaniydv/redis-server-clone-js
- Owner: ashwaniYDV
- Created: 2024-04-28T13:10:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T19:02:31.000Z (about 2 years ago)
- Last Synced: 2025-10-31T00:54:00.446Z (8 months ago)
- Topics: redis, resp, tcp
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# redis-clone-js
How to run the server
---
Install dependencies
```
npm install
```
Start the server
```
npm start
```
How to tak to the server
---
You can talk to this redis server using official [redis-cli](https://redis.io/docs/latest/develop/connect/cli/).
In another terminal you can try the following:
```
$redis-cli -p 3000
127.0.0.1:3000> ping
PONG
127.0.0.1:3000> echo "hello world"
hello world
127.0.0.1:3000> set name ashwani
OK
127.0.0.1:3000> get name
ashwani
```
Performance
-----------
My server's performance
```
$ redis-benchmark -p 3000 -t set,get, -n 100000 -q
SET: 80128.20 requests per second
GET: 89847.26 requests per second
```
Redis docker server's performance
```
$ redis-benchmark -t set,get, -n 100000 -q
SET: 41858.52 requests per second
GET: 40209.09 requests per second
```
Note: My code has huge performance due to less complexity and overhead
References
----------
* https://redis.io/docs/latest/develop/reference/protocol-spec/
* https://github.com/NodeRedis/node-redis-parser/blob/master/lib/parser.js