High-Performance AOF Database in Zig
A blazing-fast, AOF-based in-memory database optimized for maximum throughput and minimal latency.
100K+ ops/second with sub-microsecond latency. Robin Hood hashing for O(1) lookups.
Append-Only File for crash recovery and durability with background compaction.
Production-ready Docker images with web network integration and service discovery.
RwLock for concurrent reads, lock-free operations, atomic counters.
Automatic key expiration with lazy cleanup and periodic garbage collection.
Encrypted connections via stunnel proxy for production security.
Multi-threaded TCP server mode with persistent connections.
INCR/DECR operations with integer values for counters.
# Create web network
docker network create web
# Run NubDT
docker run -d \
--name nubdb-server \
--network web \
-p 6379:6379 \
-v nubdb-data:/data \
nubdb:latest
# Test connection
echo "SET hello world" | nc localhost 6379Store a key-value pair with optional TTL (seconds)
SET mykey "Hello, World!"
SET counter 100 60 # Expires in 60sOKRetrieve value by key
GET mykey"Hello, World!" or (nil)Remove a key from the database
DELETE mykeyOK or (not found)Check if key exists
EXISTS mykey1 (exists) or 0 (not found)Increment integer value by 1
INCR counterNew value (integer)Decrement integer value by 1
DECR counterNew value (integer)Get number of keys in the database
SIZEN keysDelete all keys from the database
CLEAROKfrom nubdb import NubDB
# Plain TCP connection
client = NubDB("localhost", 6379)
# Or with TLS encryption
client = NubDB("nubdbs://your-server:6380")
# Basic operations
client.set("greeting", "Hello from Python!")
result = client.get("greeting")
print(result) # "Hello from Python!"
# With TTL (expires in 60 seconds)
client.set("temp_key", "temporary", ttl=60)
# Atomic counters
client.set("views", "0")
client.incr("views") # 1
client.incr("views") # 2
# Check database size
print(client.size()) # "2 keys"