A lightweight zeromq and seld based replacement for Redis. <90 LOC focused on a portable cross language simple storage system. No need to run a full service.
bash
wget https://github.com/drbh/zedis/releases/download/v0.0001/zedis_1.0_amd64.deb
sudo apt install ./zedis_1.0_amd64.deb
bash
brew tap drbh/zedis https://github.com/drbh/zedis
brew install zedis
bash
git clone https://github.com/drbh/zedis.git && cd zedis
cargo run
```bash zedis
# ```
Zedis is opinionated and limited. With ZEDIS you can only READ and WRITE key values pairs. All writes overwrite past values.
Really Fast reads < 250µs
for ~2 MB
json payload.
Pretty Fast writes < 18ms
for ~2 MB
json payload.
Now you can set the port/socket that zedis
will be available on. If no port is specified zedis will fallback on 5555
bash
zedis 6677
GET key
Return the string values of the key. Returns b'Error occurred: InvalidKey'
if key does not exist
SET key value
Insert a key value. If the key already exists the value will be overwritten.
DEL key
Delete a key and it's value from zedis. This will also return the last known value of the key.
KEYS
This retrns a JSON format list of all of the keys. This is ineffiecent, it iterates through the whole DB and then concats the key names togther. Do not use if you have more than 1000 keys if you want instant results.
PRE keyprefix
Returns all keys with that prefix. So "A" will return "Alpha", "Awesome"... this is case sensitive.
```python import zmq import json
port = "5555"
context = zmq.Context() socket = context.socket(zmq.REQ) socket.connect("tcp://localhost:%s" % port)
socket.send_string("SET david richard blyn holtz");socket.recv()
socket._string("GET david");socket.recv()
jsonblob = json.dumps({"example": "you can store seralized JSON"}) socket.send_string("SET js "+jsonblob);socket.recv()
socket.send_string("GET js") json.loads(socket.recv())
socket.send_string("DEL js");socket.recv();socket.recv()
for x in range(0, 100): socket.send_string("SET "+str(x)+" "+str(x)+" yo yo") socket.recv()
socket.send_string("PRE 1");socket.recv()
socket.send_string("KEYS");socket.recv()
```
```bash nc -v -z -w 5 localhost 5555
```
01010
Developer StuffClone, build and add a symlink so you can access zedis
in the cli
bash
git clone https://github.com/drbh/zedis.git && cd zedis
cargo build --release && sh install.sh
fpm -f -s dir -t deb -n zedis target/release/zedis=/usr/local/