Skip to main content

ZEDIS

Logo

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.

Install

This will always fetch and build the most recent version of zedis for your computer. If you don't have cargo checkout https://www.rust-lang.org/tools/install

cargo install zedis
Logo

Not supporting apt and homebrew anymore, too many places to update.

Run 👍

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.

Setting Port

Now you can set the port/socket that zedis will be available on. If no port is specified zedis will fallback on 5555

zedis 6677

Interacting with CLI app

get zedis cli Logo

Commands

Get values

GET key

Return the string values of the key. Returns b'Error occurred: InvalidKey' if key does not exist

Set values

SET key value

Insert a key value. If the key already exists the value will be overwritten.

Remove values

DEL key

Delete a key and it's value from zedis. This will also return the last known value of the key.

Show keys

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.

Query

PRE keyprefix

Returns all keys with that prefix. So "A" will return "Alpha", "Awesome"... this is case sensitive.

Python3 client example

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()
# 'done.'

socket._string("GET david");socket.recv()
# 'richard blyn holtz'

jsonblob = json.dumps({"example": "you can store seralized JSON"})
socket.send_string("SET js "+jsonblob);socket.recv()
# 'done.'

socket.send_string("GET js")
json.loads(socket.recv())
# {u'exmple': u'lorem ipsum...'}

socket.send_string("DEL js");socket.recv();socket.recv()
# b'2 yo yo'

## ADDING A BUNCH OF KEYS
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()
# b'["1", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"]'


socket.send_string("KEYS");socket.recv()
# b'["0", "1", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22"]'

Check alive

nc -v -z -w 5 localhost 5555
# found 0 associations
# found 1 connections:
#      1:	flags=82<CONNECTED,PREFERRED>
# 	outif lo0
# 	src 127.0.0.1 port 52227
# 	dst 127.0.0.1 port 5555
# 	rank info not available
# 	TCP aux info available

# Connection to localhost port 5555 [tcp/personal-agent] succeeded!

🦀 01010 Developer Stuff

Build it

Clone, build and add a symlink so you can access zedis in the cli

git clone https://github.com/drbh/zedis.git && cd zedis
cargo build --release && sh install.sh 

Packaging

fpm -f -s dir -t deb -n zedis target/release/zedis=/usr/local/

Release files for pyzedis 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyzedis 0.0.1
File Size Uploaded
pyzedis-0.0.1.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyzedis 0.0.1
File Interpreter ABI Platform
pyzedis-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / pyzedis-0.0.1.tar.gz

Download URL pyzedis-0.0.1.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a7970a7552d6c4090727356b209d460136f6321aa5eb11e8892053e990cfb2fa
BLAKE2b-256 checksum
How to use checksums
22d7941674b9e043a4758bfa4a6a647274081d0e9b2e9446d4be57965430b3d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.1

Release files / pyzedis-0.0.1-py3-none-any.whl

Download URL pyzedis-0.0.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9277c42272a7550b4bb9d2c377bcaeb51634647b57375961cd6783df1147e834
BLAKE2b-256 checksum
How to use checksums
23f783a1639abaaf90c9fd9c944815d5558c40bcc112f1f30270cb01659e4d49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page