High-Performance In-Memory Key-Value Store & Message Broker
Synap is a modern, high-performance data infrastructure system built in Rust, combining the best features of Redis, RabbitMQ, and Kafka into a unified platform for real-time applications.
Synap provides multiple core capabilities in a single, cohesive system:
- πΎ Key-Value Store - Sharded in-memory storage with TTL, LRU/LFU eviction, and atomic operations
- π§± Redis-compatible data structures - Hashes, Lists, Sets, Sorted Sets, Bitmaps, HyperLogLog, Geospatial indexes, and string extensions (APPEND, GETRANGE, SETRANGE, β¦)
- π Lua Scripting - Server-side scripting with EVAL/EVALSHA and a redis.call() bridge
- π Transactions - MULTI/EXEC/WATCH/DISCARD β atomic, durable (single WAL group-commit), replicated, and isolated from concurrent writers
- βΈοΈ Blocking operations - BLPOP/BRPOP/BRPOPLPUSH and BZPOPMIN/BZPOPMAX with Redis timeout semantics
- π Cursor scans - SCAN plus HSCAN/SSCAN/ZSCAN with MATCH glob and COUNT
- π Keyspace notifications - Redis-style
notify-keyspace-events(__keyspace@0__:*/__keyevent@0__:*) via Pub/Sub - π KV Watch -
KV.WATCH <pattern>streams value-carrying change events ({ key, event, version, value? }) over SynapRPC push or the/kv/wsWebSocket β a watcher never has to re-GET; available in all six SDKs - π¨ Acknowledgment Queues - RabbitMQ-style message queues with delivery guarantees, DLQ, priorities, and per-consumer prefetch/QoS
- π‘ Event Streams - Kafka-style partitioned topics with consumer groups, retention policies, and consumer-offset-aware buffering
- π Pub/Sub Messaging - Topic-based publish/subscribe with wildcard support
- π Redis 7 parity, measured: driven by the same
redis-benchmarkbinary, Synap matches Redis at-P 1on every command and sits at 0.85β0.95 pipelined on a single hot key β see Performance - π Wins on realistic workloads: with a randomized keyspace, Synap beats Redis 7 on SET/INCR/LPUSH by 14β25%, and at 200 connections wins SET at 1.19Γ
- π Native SynapRPC protocol: ~3Γ faster than the RESP3 compatibility path per operation (166k vs 56k rps at
-P 1) - π§΅ Zero-copy hot paths: values live behind shared
Arc<[u8]>buffers β parsed once, stored, replied, and replicated by refcount bump, no payload memcpy - πΎ Efficient Memory: 92MB for 1M keys (vs ~200MB in Redis)
- π 64-Way Sharding: multi-core scalability with lock-free atomic stats
- βοΈ Async I/O: Built on Tokio for non-blocking operations
- ποΈ Smart Compression: LZ4/Zstd compression with minimal CPU overhead
- β‘ SIMD Acceleration: Runtime-dispatched AVX2/NEON/SIMD128 for BITCOUNT, BITOP, PFMERGE β up to 9.5Γ faster than scalar on HyperLogLog merge
- π Authentication on every transport - HTTP, RESP3, SynapRPC, and MCP all gate commands behind auth; destructive/admin commands (FLUSHALL, CONFIG, SHUTDOWN, β¦) additionally require admin
- π bcrypt password hashing - Constant-time comparison; legacy SHA-512 hashes transparently rehash on next login
- π‘οΈ Fine-grained Permissions - Users, API keys (expiration, IP filtering), resource-based ACLs
- π Audit Logging - Track all authentication events (login, API key usage, permission denials)
- π§― DoS hardening - Parsers cap client-controlled allocations, bounded pub/sub channels, connection limits + idle timeouts on the binary listeners, no reachable panics
- π Safe defaults - Binary listeners (RESP3/SynapRPC) bind to loopback by default
- πΎ Full Persistence: WAL + Snapshots covering all datatypes β KV, Hash, List, Set, Sorted Set, Queue, and Stream
- π Async WAL with group commit: Redis-style batching (10K ops/batch, 100Β΅s window); transactions commit as one atomic fsync
- π§Ύ Verified snapshots: CRC64 recomputed on load β corrupt/torn snapshots are rejected, never silently loaded
- π§ True
maxmemory: a shared budget sums every datatype (not just KV), with per-datatype accounting exposed as metrics - βοΈ PACELC Model: PC/EL (Consistency during partition, Latency in normal operation)
- β±οΈ Recovery Time: 1-10 seconds from snapshots + WAL replay
- π Master-Slave Replication: 1 write master + N read replicas, wired directly from config
- Every datatype converges β KV, hash, list, set, sorted set, queue, stream β via the same applier the WAL recovery path uses
- Full sync via snapshot transfer (CRC verified) + partial sync via replication log; replicas joining mid-write-stream lose nothing
- Works with persistence disabled (replication is decoupled from the WAL)
- Auto-reconnect with intelligent resync;
INFO replicationreports live role, replica count, offset, and lag
- β Message Acknowledgment: Guaranteed message delivery with ACK/NACK
- π Event Replay: Stream history and replay; retention protects events the slowest consumer hasn't read
- π Manual Failover: Promote replica to master capability
- π§© Cluster mode (preview): hash-slot topology (16384 slots), slot migration with rollback, and inter-node quota RPC β initialized from config, disabled by default
- π INFO Command - Redis-style server introspection (server, memory, stats, replication, keyspace)
- π SLOWLOG - Slow query logging with configurable threshold (default 10ms)
- πΎ MEMORY USAGE - Per-key memory tracking across all data types
- π₯ CLIENT LIST - Active connection tracking and management
- π Prometheus Metrics - process-scoped CPU/memory plus broker-level gauges (per-stream length, consumer-group lag, queue depth) at
GET /metricsβ see Observability
- π€ AI Integration: MCP support for Cursor, Claude Desktop, and AI assistants
- π StreamableHTTP Protocol: Simple HTTP-based streaming protocol
- π WebSocket Support: Persistent connections for real-time updates
- π Multi-language SDKs: TypeScript, Python, Rust (with reactive PubSub), Go, PHP, and C# clients with full authentication support
- π Rich Examples: Chat, event broadcasting, task queues, authentication examples, and more
Synap supports three wire transports. All SDKs (Rust, TypeScript, Python, Go, PHP, C#) select the transport via URL scheme β no separate builder options required.
| URL scheme | Port | Framing | When to use |
|---|---|---|---|
synap:// |
15501 |
MessagePack over TCP | β Recommended default β lowest latency, binary, persistent connection, native type fidelity |
resp3:// |
6379 |
Redis text protocol over TCP | Redis-compatible tooling, redis-cli, existing Redis client libraries |
http:// / https:// |
15500 |
JSON over HTTP | Ad-hoc curl, webhooks, browsers |
π‘ Recommendation β use
synap://. SynapRPC is the preferred transport for production workloads: it keeps a persistent multiplexed TCP connection, avoids HTTP framing overhead, and preserves integer/float/bool/bytes types on the wire (no stringification). All data commands β KV, hashes, lists, sets, sorted sets, queues, streams, pub/sub, transactions, scripts, geospatial, HyperLogLog β are supported on every transport (streams and transactional write-queuing landed on the native wires in 1.3.0; queued writes travel asTXQUEUE, see Transports).Since 1.2.0 the
synap://wire is Thunder β the HiveLLM family's shared binary RPC β on both ends: the server listener and the Rust, TypeScript, Python and C# SDKs run the same protocol implementation, so the two halves of a connection cannot drift. Wire v1 is frozen; a pre-1.2.0 client still interoperates. Every SDK β Rust, TypeScript, Python, C#, Go and PHP β runs the same protocol implementation, verified against one server build by the interop matrix, seedocs/thunder-interop-matrix.md.// TypeScript const synap = new SynapClient("synap://127.0.0.1:15501");# Python client = SynapClient(SynapConfig("synap://127.0.0.1:15501"))// Rust let cfg = SynapConfig::new("synap://127.0.0.1:15501");// PHP $client = new SynapClient(new SynapConfig("synap://127.0.0.1:15501"));// C# var client = new SynapClient(SynapConfig.Create("synap://127.0.0.1:15501"));
β οΈ No silent HTTP fallback. Native transports (synap://,resp3://) raiseUnsupportedCommandErrorfor any command not mapped on that transport instead of silently falling back to HTTP. Usehttp://if you need full REST access for commands outside the parity matrix.
Additional integration protocols:
- π€ MCP (Model Context Protocol): Configurable tools (KV, Hash, List, Set, Queue, Sorted Set) at
/mcpendpoint with authentication support - π UMICP (Universal Matrix Inter-Communication Protocol): 13 operations via MCP bridge with TLS support
- π Read Scaling: Multiple replica nodes for distributed reads
- π Event Rooms: Isolated event streams per room/channel
- π― Partitioned Topics: Kafka-style horizontal scaling with multiple partitions
- π₯ Consumer Groups: Coordinated consumption with automatic rebalancing
- π Topic Routing: Efficient pub/sub with wildcard matching
- π Connection Pooling: Client-side connection management
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Synap Server β
ββββββββββββββββββββ¬βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ€
β HTTP/REST β SynapRPC (TCP) β RESP3 (TCP) β
β :15500 β :15501 (msgpack) β :6379 (Redis text) β
ββββββββββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββ€
β server/handlers/ (17 modules) β
β kv Β· hash Β· list Β· set Β· sorted_set Β· hll Β· bitmap Β· geospatial β
β queue Β· stream Β· pubsub Β· script Β· websocket Β· partition Β· cluster β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β protocol/resp3/command/ protocol/synap_rpc/dispatch/ β
β kv Β· collections Β· advanced kv Β· collections Β· advanced β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β core/ (data stores) β
β kv_store/ bitmap/ hash list set sorted_set hll geospatial β
β queue stream pubsub transactions scripting β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Replication Log (Append-Only) Β· WAL + Snapshots persistence β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Master Node Replica Nodes (Read-Only) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Since v1.0.0 the workspace is split into focused crates under crates/
(Vectorizer/Nexus layout). Layers go Foundation β Core β Features β Presentation;
higher layers depend on lower, never the reverse.
crates/
βββ synap-core/src/core/ # In-memory data engine (leaf crate β no server deps)
β βββ kv_store/ # Sharded KV store (TTL, eviction, atomic LRU)
β βββ hash Β· list Β· set Β· sorted_set Β· bitmap Β· hyperloglog Β· geospatial
β βββ queue Β· stream Β· pubsub Β· partition Β· transaction Β· consumer_group
βββ synap-server/src/ # HTTP/WS/MCP/UMICP + protocol dispatch
β βββ server/handlers/ # REST handlers (kv, hash, list, set, queue, stream, pubsub, β¦)
β βββ protocol/resp3/ # RESP3 parser/writer + listener + command dispatcher
β βββ protocol/synap_rpc/ # SynapRPC command catalog + config + listener (wire: thunder)
β βββ persistence/ # WAL (async group-commit) + snapshots
β βββ replication/ # master / replica
β βββ auth/ Β· hub/ # users/api-keys/ACL + HiveHub.Cloud multi-tenant
βββ synap-cli/ # Command-line client
βββ synap-migrate/ # Migration utilities
sdks/rust/src/ # Rust SDK β Thunder's client under the hood
βββ transport/ # SynapRPC / RESP3 / HTTP transports + command mappers
The binary RPC wire layer is not in this repository. It is Thunder (
thunder-rpc), the HiveLLM family's shared implementation, which both the server and the Rust SDK depend on β so the two ends of the wire cannot drift.Rust library consumers:
synap_server::core::*is nowsynap_core::*(umbrella re-exports kept onsynap_serverfor transition), and the formersynap-protocolcrate is gone β see the CHANGELOG for the type-by-type migration tothunder-rpc.
From GitHub Releases (Recommended):
Pre-built binaries for Linux (x86_64), macOS (Intel and Apple Silicon), and Windows (x86_64) are published on the GitHub Releases page.
# Example (Linux x86_64) β replace <version> with the latest release
wget https://github.com/hivellm/synap/releases/download/v<version>/synap-linux-x86_64.tar.gz
tar -xzf synap-linux-x86_64.tar.gz
cd synap-linux-x86_64
./synap-server --config config/config.ymlπ³ Docker:
Quick Start (Docker Hub):
# Pull and run latest image
docker pull hivehub/synap:latest
docker run -d \
--name synap \
-p 15500:15500 \
-p 15501:15501 \
-v synap-data:/data \
hivehub/synap:latest
# Check health
curl http://localhost:15500/healthBuild Locally:
# Clone and build
git clone https://github.com/hivellm/synap.git
cd synap
docker build -t hivehub/synap:latest .
# Run container
docker run -d \
--name synap-server \
-p 15500:15500 \
-p 15501:15501 \
-v synap-data:/data \
hivehub/synap:latestWith Authentication:
docker run -d \
--name synap-server \
-p 15500:15500 \
-p 15501:15501 \
-v synap-data:/data \
-e SYNAP_AUTH_ENABLED=true \
-e SYNAP_AUTH_REQUIRE_AUTH=true \
-e SYNAP_AUTH_ROOT_USERNAME=admin \
-e SYNAP_AUTH_ROOT_PASSWORD=SecurePassword123! \
-e SYNAP_AUTH_ROOT_ENABLED=true \
hivehub/synap:latestMulti-Architecture Build:
# Build and push multi-arch images (AMD64 + ARM64)
./scripts/docker/docker-publish.sh 1.3.1
# Or using PowerShell
.\scripts\docker\docker-publish.ps1 1.3.1Docker Compose:
# Use docker-compose for replication setup
docker-compose up -d
# With authentication (set environment variables)
export SYNAP_AUTH_ENABLED=true
export SYNAP_AUTH_REQUIRE_AUTH=true
export SYNAP_AUTH_ROOT_USERNAME=admin
export SYNAP_AUTH_ROOT_PASSWORD=SecurePassword123!
docker-compose up -dAvailable Images:
hivehub/synap:latest- Latest stable releasehivehub/synap:<version>- Specific version (e.g.hivehub/synap:1.3.1)- Supports
linux/amd64andlinux/arm64architectures
π For detailed Docker documentation, see DOCKER_README.md
π οΈ From Source:
# Clone repository
git clone https://github.com/hivellm/synap.git
cd synap
# Build from source (requires Rust nightly 1.92+)
cargo build --release
# Run server
./target/release/synap-server --config config/config.ymlSee Development Guide for detailed build instructions.
# Start server (default port 15500)
synap-server
# Key-Value Operations
curl -X POST http://localhost:15500/kv/set \
-H "Content-Type: application/json" \
-d '{"key": "user:1", "value": "John Doe", "ttl": 3600}'
curl http://localhost:15500/kv/get/user:1
# Queue Operations
curl -X POST http://localhost:15500/queue/publish \
-d '{"queue": "tasks", "message": "process-video", "priority": 1}'
curl http://localhost:15500/queue/consume/tasks
# Event Stream
curl -X POST http://localhost:15500/stream/publish \
-d '{"room": "chat-room-1", "event": "message", "data": "Hello!"}'
# Pub/Sub
curl -X POST http://localhost:15500/pubsub/publish \
-d '{"topic": "notifications.email", "message": "New order"}'
# With Authentication (if enabled)
curl -X POST http://localhost:15500/kv/set \
-H "Authorization: Basic $(echo -n 'admin:password' | base64)" \
-H "Content-Type: application/json" \
-d '{"key": "user:1", "value": "John Doe"}'
# Or with API Key
curl -X POST http://localhost:15500/kv/set \
-H "Authorization: Bearer sk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"key": "user:1", "value": "John Doe"}'Authentication is disabled by default for development. Enable it for production:
Features:
- β Root User Management - Configurable root user with full permissions
- β User Management - Create, delete, enable/disable users
- β API Key Management - Generate, revoke, and manage API keys with expiration
- β Fine-grained Permissions - Resource-based permissions (RabbitMQ-style)
- β Basic Auth & Bearer Token - Support for both authentication methods
- β Audit Logging - Track all authentication events (login, API key usage, permission denials)
- β Password Validation - Configurable password requirements (length, complexity)
- β IP Filtering - Restrict API keys to specific IP addresses
Via Config File (config/config.yml):
auth:
enabled: true
require_auth: true
root:
username: "root"
password: "your_secure_password"
enabled: trueVia Docker Environment Variables:
docker run -d -p 15500:15500 \
-e SYNAP_AUTH_ENABLED=true \
-e SYNAP_AUTH_REQUIRE_AUTH=true \
-e SYNAP_AUTH_ROOT_USERNAME=root \
-e SYNAP_AUTH_ROOT_PASSWORD=your_secure_password \
synap:latestUsing Authentication:
# Basic Auth
curl -u root:password http://localhost:15500/kv/get/user:1
# Bearer Token (API Key)
curl -H "Authorization: Bearer sk_XXXXX..." http://localhost:15500/kv/get/user:1
# Query Parameter
curl "http://localhost:15500/kv/get/user:1?api_key=sk_XXXXX..."See Authentication Guide for complete details.
Synap supports master-slave replication for high availability and read scaling.
# Start 1 master + 3 replicas
docker-compose up -d
# Master available at: localhost:15500
# Replica 1 at: localhost:15510
# Replica 2 at: localhost:15520
# Replica 3 at: localhost:15530Master Node Configuration (config/config-master.yml):
server:
host: "0.0.0.0"
port: 15500
replication:
enabled: true
role: "master"
replica_listen_address: "0.0.0.0:15600" # 15600 = replication (SynapRPC uses 15501)
heartbeat_interval_ms: 1000
max_lag_ms: 10000
buffer_size_kb: 256
replica_timeout_secs: 30
persistence:
enabled: true
wal:
enabled: true
path: "./data/wal/synap.wal"
snapshot:
enabled: true
directory: "./data/snapshots"Replica Node Configuration (config/config-replica.yml):
server:
host: "0.0.0.0"
port: 15500
replication:
enabled: true
role: "replica"
master_address: "master:15600" # Master's replication port
heartbeat_interval_ms: 1000
max_lag_ms: 10000
buffer_size_kb: 256
auto_reconnect: true
reconnect_delay_ms: 5000
persistence:
enabled: true
wal:
enabled: true
path: "./data/wal/synap.wal"
snapshot:
enabled: true
directory: "./data/snapshots"Start Nodes:
# Terminal 1: Start master
synap-server --config config/config-master.yml
# Terminal 2: Start replica 1
synap-server --config config/config-replica.yml
# Terminal 3: Start replica 2
synap-server --config config/config-replica.ymlWrite to Master:
# All writes go to master
curl -X POST http://localhost:15500/kv/set \
-H "Content-Type: application/json" \
-d '{"key": "user:100", "value": "Alice", "ttl": 3600}'Read from Replicas (Load Balancing):
# Read from replica 1 (eventually consistent, ~5ms lag)
curl http://localhost:15510/kv/get/user:100
# Read from replica 2
curl http://localhost:15520/kv/get/user:100
# Read from replica 3
curl http://localhost:15530/kv/get/user:100Monitor Replication Status:
# Check replication health on master
curl http://localhost:15500/health/replication
# Check replication status on replica
curl http://localhost:15501/health/replication- Master Reads: Strongly consistent (immediate)
- Replica Reads: Eventually consistent (~5-10ms lag typical)
- Write Durability: Writes confirmed after master commit
- Replication: Asynchronous to replicas
- Lag Monitoring: Real-time offset tracking
See docs/specs/REPLICATION.md for complete replication documentation.
For detailed Docker deployment guide, see:
- DOCKER_README.md - Complete Docker Hub documentation with examples
- docs/specs/DOCKER_DEPLOYMENT.md - Advanced deployment guide
Use event streams for room-based messaging with message history and guaranteed delivery.
Leverage acknowledgment queues for distributed task processing with retry logic.
Utilize key-value store as a high-speed cache with TTL support.
Implement pub/sub for system-wide notifications and event distribution.
Use queues for reliable inter-service messaging with delivery guarantees.
- Language: Rust (Edition 2024, workspace of focused crates:
synap-core,synap-server,synap-cli,synap-migrate) - Runtime: Tokio (async/await)
- Web Framework: Axum
- Storage: 64-way sharded stores (ahash) with
Arc<[u8]>shared values; radix trie for pub/sub topic routing - Serialization: serde (JSON, MessagePack)
- Protocols: SynapRPC + RESP3 + HTTP/StreamableHTTP + WebSocket + MCP + UMICP
- User Guide - Complete getting started guide (Installation, Quick Start, Operations)
- Admin Guide - Operations handbook (Deployment, Monitoring, HA, Security)
- Tutorials - 8 practical tutorials (Chat, Queues, Caching, Pub/Sub)
- Architecture - System architecture and components
- Configuration - Complete configuration reference
- CLI Guide - Synap CLI usage and commands
- Transports - SynapRPC / RESP3 / HTTP command-parity matrix
- Transactions - MULTI/EXEC durability, replication, and isolation
- KV Watch - Value-carrying change streams, modes, version ordering, fan-out cost
- Replication - Setup, sync semantics, and monitoring
- Memory Accounting -
maxmemoryacross all datatypes - Observability - Prometheus metrics reference
- Authentication - Complete auth guide (users, roles, API keys, ACL)
- Network Limits - Connection caps, idle timeouts, parser bounds
- REST API - Complete REST API documentation
- OpenAPI Spec - OpenAPI 3.0 specification (YAML/JSON)
- StreamableHTTP - StreamableHTTP protocol
- MCP Integration - Model Context Protocol
- UMICP Integration - UMICP protocol
- Redis vs Synap - Live
redis-benchmarkhead-to-head - Benchmarks - All benchmark suites and results
- Queue Concurrency - Zero-duplicate guarantees
- Testing Strategy - Test coverage and approach
- Development Guide - Setup and contribution guide
- Design Decisions - Technical choices
- Roadmap - Development roadmap and timeline
- Project DAG - Component dependencies and implementation order
- Deployment - Production deployment
- Packaging - Distribution packages
- Key-Value Store - Sharded storage system
- Queue System - Message queues with ACK
- Event Stream - Room-based broadcasting
- Pub/Sub - Topic-based messaging
- Replication - Master-slave architecture
- SDK Index - All six SDKs: transports, module coverage, quick start
- TypeScript SDK - Node.js and browser support
- Python SDK - Async/sync Python client
- Rust SDK - Native Rust client library
- Go SDK - Standalone repository, vendored here as a submodule
- PHP SDK - Standalone repository, vendored here as a submodule
- C# SDK - .NET 8+ client library
- Real-Time Chat - Multi-room chat application
- Event Broadcasting - System-wide events
- Task Queue - Distributed task processing
- Pub/Sub Pattern - Notification system
Both servers driven by the same redis-benchmark binary over RESP
(release build, containers on one Docker network, persistence and auth off on
both sides). Full methodology and history:
docs/benchmarks/redis-vs-synap.md
Single hot key (Redis's best case β sharding buys Synap nothing):
| Shape | Result |
|---|---|
-P 1 (per-op latency) |
Parity β within ~5% of Redis on every command; Synap ahead on GET, RPUSH, LRANGE |
-P 16 (pipelined) |
0.85β0.95 of Redis on GET/SET/SADD/INCR (~750β815k rps); Synap wins LPUSH at 1.51Γ, ties LRANGE |
Randomized 1M keyspace (the realistic shape β Synap's shards parallelize, Redis stays serial):
| Op | Synap rps | Redis rps | Synap/Redis |
|---|---|---|---|
| SET (c=50) | 797,872 | 700,935 | β 1.14 |
| INCR (c=50) | 761,421 | 607,287 | β 1.25 |
| LPUSH (c=50) | 641,026 | 513,699 | β 1.25 |
| GET (c=50) | 742,574 | 789,474 | 0.94 |
| SET (c=200) | 742,000 | β | β 1.19 |
| INCR (c=200) | 675,000 | β | β 1.03 |
Native SynapRPC (Synap's own protocol; RESP3 exists for compatibility) is
~3Γ faster per operation than the RESP3 path β 166β170k rps vs ~56k at
-P 1 β and ~2.8Γ faster than HTTP/JSON on a SET+GET round-trip.
Memory: 92 MB for 1M keys vs ~200 MB in Redis (54% less).
| Optimization | Effect |
|---|---|
TCP_NODELAY + buffered writes |
Non-pipelined GET 1.1k β 56k rps (52Γ); pipelined 17k β 833k (48Γ) |
Per-key write lock: mutex β sharded RwLock + try_read fast path |
Pipelined SET 130k β 785k; c=200 writes went from 0.24Γ to 1.19Γ Redis |
Zero-copy values (Arc<[u8]> end-to-end) |
SET stores the parser's buffer by refcount bump; GET/MGET reach the socket without copying |
| Hot-path allocations removed (dispatch, replies, metrics, INCR in-place) | INCR 480k β ~800k rps; SADD 630k β ~800k |
| SIMD (AVX2/NEON) BITCOUNT/BITOP/PFMERGE | Up to 64 GiB/s popcount, 9.5Γ faster HLL merge |
| O(1) stream consume seek + per-queue deadline min-heap | Consume/ACK sweeps no longer scan whole buffers |
Tests: 1,800+ across the workspace β’ Benchmarks: 13 criterion suites + synap-bench load generator
| Feature | Synap | Redis | RabbitMQ | Kafka |
|---|---|---|---|---|
| Key-Value | β | β | β | β |
| Hashes / Lists / Sets / Sorted Sets | β | β | β | β |
| Geospatial / Bitmaps / HyperLogLog | β | β | β | β |
| Lua Scripting | β | β | β | β |
| Transactions (MULTI/EXEC/WATCH) | β (durable + replicated) | β | β | β |
| Blocking Pops (BLPOP/BZPOPMINβ¦) | β | β | β | β |
| Keyspace Notifications | β | β | β | β |
| KV Watch (value-carrying) | β
(KV.WATCH + /kv/ws) |
β (notify-only) | β | β |
| Queues (ACK) | β | β | β | β |
| Consumer Prefetch/QoS | β | β | β | β |
| Priority Queues | β (0-9) | β | β | β |
| Dead Letter Queue | β | β | β | β |
| Event Streams | β | β (Limited) | β | β |
| Partitioned Topics | β | β | β | β |
| Consumer Groups | β | β | β | β |
| Retention Policies | β (5 types) | β (2 types) | β (1 type) | β (2 types) |
| Pub/Sub | β | β | β | β |
| Authentication | β (Users+API Keys) | β (ACL) | β (Users) | β (SASL) |
| RBAC | β | β (Limited) | β | β |
| API Key Expiration | β | β | β | β |
| IP Filtering | β | β | β | β |
| Replication | β (Master-Slave, all datatypes) | β | β | β |
| Persistence | β (WAL+Snapshot, CRC-verified) | β (AOF/RDB) | β (Disk) | β (Log) |
| PACELC Model | PC/EL | PC/EL | PC/EC | PA/EL |
| Native Compression | β (LZ4/Zstd) | β | β | β (Snappy) |
| StreamableHTTP | β | β | β | β |
| MCP Support | β (Configurable, Auth) | β | β | β |
| UMICP Support | β (13 ops, TLS) | β | β | β |
| Enhanced Monitoring | β (INFO, SLOWLOG, MEMORY, Prometheus) | β (INFO) | β | β |
| Password Hashing | β (bcrypt) | β (SHA256) | β (bcrypt) | β (SASL) |
| AI Integration | β (MCP+UMICP) | β | β | β |
| Matrix Operations | β (via UMICP) | β | β | β |
| Single Binary | β | β | β | β |
| Zero-Duplicate Guarantee | β (Tested) | N/A | β | β |
Legend: β Implemented | π In Progress | β Not Available
Apache License 2.0 - See LICENSE for details.
See DEVELOPMENT.md for development setup and contribution guidelines.