Zettuce

What Zettuce is

Zettuce ("Zero-Copy Lettuce") is a fast, zero-dependency alternative to the Java Lettuce client for Valkey and Redis-compatible servers—backed by one C11 networking engine shared across Java 22+ FFM, Rust, Python, and C.

Why replace Lettuce?

Lettuce is built on Netty and Project Reactor. Even for a simple synchronous GET or SET, a Lettuce request hops from your application thread onto a Netty event-loop thread, allocates command and ByteBuf wrappers, copies buffers through the OS kernel TCP stack, waits for an epoll wakeup, decodes RESP objects on the JVM heap, and signals back to the caller thread.

Zettuce removes every one of those hops:

Four transport modes

RDMA (default — Valkey)
Uses Valkey's native RDMA module (valkey-rdma.so) over RoCE or InfiniBand. Loads libibverbs.so.1 and librdmacm.so.1 dynamically at runtime via dlopen. Requires Valkey (Redis does not support RDMA).
TCP (Valkey & Redis)
Works with any standard Valkey or Redis server—no RDMA NIC required. Automatically uses Linux io_uring on Linux 5.6+ and falls back silently to optimized epoll when blocked by container seccomp profiles or when ZETTUCE_TCP_NO_IOURING=1 is set.
UNIX (Unix Domain Sockets — Valkey & Redis)
Connects to a local Valkey or Redis socket path (e.g., /var/run/valkey/valkey.sock, /var/run/redis/redis.sock, or unix:///tmp/valkey.sock) over AF_UNIX using the same single-syscall io_uring / epoll engine—ideal for co-located sidecars and single-host deployments.
AUTO
Attempts RDMA on the primary port first; if RDMA hardware, the RDMA listener, or RDMA support (such as on Redis) is unavailable, transparently connects over TCP on tcpFallbackPort (or the same port). Ideal for running one codebase across CI, cloud VMs, Redis, and RDMA Valkey racks.

Platform support (Linux native engine + pure-Java dev fallback): Zettuce's native C11 engine targets Linux x86_64 and aarch64 (RDMA verbs, Linux io_uring, epoll, and AF_UNIX). On macOS/Windows developer workstations or older-glibc Linux hosts, zettuce-java automatically falls back to a zero-dependency pure-Java TCP/Unix RESP2/RESP3 backend for TCP, AUTO, and UNIX transports. For production non-Linux servers (Windows/FreeBSD), use Lettuce.

Shared C11 architecture

Java 22+ FFM zettuce-java Rust FFI zettuce-rs Python C-Ext py-zettuce Native C11 zettuce-c zettuce-c (Shared C11 Engine — .so for Java, static in Rust & Python) RESP2/3 Slab Arena · Batching · Session Replay · Cluster CRC16 · Pub/Sub · Sentinel · Metrics RDMA Kernel-Bypass Transport IBV_WR_RDMA_WRITE_WITH_IMM · 0 syscalls TCP Transport (io_uring + epoll) Linked SEND+RECV (1 syscall) · AUTO fallback
All four language bindings share one language-neutral C11 core, ensuring identical protocol semantics, reconnect replay, and observability everywhere.

Full feature coverage

License

Zettuce — including the C11 engine, Java FFM client, Rust crate, Python C-extension, and test suites — is open source under the Apache License, Version 2.0.