Zettuce
Apache 2.0 · Linux · Java 22+ FFM · Rust · Python · C11

Zero-copy speed.
Drop-in Lettuce alternative.

Zettuce replaces Netty and kernel TCP copies with a single zero-dependency C11 engine for Valkey and Redis. Transfer Valkey data directly from Host A's memory to Host B's memory over RDMA in 7.98 µs — or connect to Redis or Valkey over Linux io_uring TCP (and Unix sockets) and still beat Lettuce 7.9 by up to 2.6×.

TRADITIONAL TCP / NETTY (LETTUCE) 38.2 µs · 4 copies · CPU busy HOST A · CLIENT HOST B · VALKEY 9.2 TCP packets context switches + 4 memory copies App Heap ByteBuf CPU + Kernel syscall + TCP NIC A (DMA) 1 user→kern 2 kern→NIC NIC B (IRQ) CPU + Kernel IRQ + sk_buff Valkey recv buf 3 NIC→kern 4 kern→user 1 2 3 4 ZETTUCE ZERO-COPY RDMA (KERNEL & CPU BYPASS) 7.98 µs · 0 copies · 0 syscalls HOST A · ZETTUCE CLIENT CPU / OS Kernel BYPASSED Host A RAM (MR) Zero-Copy Direct DMA RDMA HCA A MMIO Doorbell HOST B · VALKEY 9.2 RDMA CPU / OS Kernel BYPASSED RDMA HCA B Direct Write Host B RAM (MR) Valkey RX Ring Buffer RDMA_WRITE_WITH_IMM RoCE / InfiniBand RAM → HCA → Wire → HCA → RAM · zero kernel involvement
7.98 µs

Java 25 median RDMA round-trip (9.72 µs p99) against Valkey 9.2.0 across two hosts.

5.13×

Higher single-connection throughput over RDMA than Lettuce 7.9.0 with native Netty Epoll.

1.76×

Faster than Lettuce 7.9.0 even over plain TCP via 1-syscall Linux io_uring.

0 deps

No Netty, no Reactor, no liburing. One C11 engine shared by Java FFM, Rust, Python, and C.

Measured on two AlmaLinux 10.2 hosts (Linux 6.12, Mellanox ConnectX-3 RoCE) against Valkey 9.2.0. Full methodology and tables.

Why switch from Lettuce?

Lettuce was built for an era before Java Panama FFM, Linux io_uring, and Valkey-over-RDMA. Zettuce keeps a clean, familiar client API while stripping away every layer between your application and the wire.

Valkey & Redis support: Zettuce works with both Valkey and Redis over TCP (io_uring / epoll) and Unix domain sockets (AF_UNIX) — giving Redis users the same 1.7×–2.6× speedup over Lettuce with zero Netty dependencies. Kernel-bypass RDMA is supported with Valkey (valkey-rdma.so), as Redis does not support RDMA.

Platform support — Linux native engine (+ pure-Java dev fallback): Zettuce's native C11 engine targets Linux x86_64 and aarch64 because it talks directly to Linux-native interfaces: libibverbs/librdmacm (Valkey-over-RDMA), raw io_uring syscalls (linked SEND + RECV), epoll, and Linux AF_UNIX domain sockets. 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 so local development and tests work out of the box. For production non-Linux deployments (Windows/FreeBSD), use Lettuce.

How Zettuce compares to Lettuce 7.9

Head-to-head on two physical servers against Valkey 9.2.0 (OpenJDK 25, Lettuce 7.9.0.RELEASE with native Netty 4.2.17 Epoll verified active). Every Zettuce bar uses the exact same Java API—only the transport option changes.

PING p50 latency (pipe=1)

microseconds; shorter is better

Clientp50 latency
Zettuce Java RDMA7.98 µs (4.8× lower)
Zettuce Java TCP (io_uring)23.55 µs (1.6× lower)
Lettuce 7.9 (Epoll TCP)38.22 µs

PING p99 tail latency (pipe=1)

microseconds; shorter is better

Clientp99 latency
Zettuce Java RDMA9.72 µs (8.3× lower)
Zettuce Java TCP (io_uring)36.81 µs (2.2× lower)
Lettuce 7.9 (Epoll TCP)81.12 µs

GET 64B throughput (pipe=1)

operations/sec; longer is better

Clientops/sec
Zettuce Java RDMA111,023 ops/s (4.94×)
Zettuce Java TCP (io_uring)37,562 ops/s (1.67×)
Lettuce 7.9 (Epoll TCP)22,480 ops/s

Pipelined GET 64B throughput (pipe=64)

operations/sec; longer is better

Clientops/sec
Zettuce Java RDMA1,171,494 ops/s (4.52×)
Zettuce Java TCP (io_uring)678,387 ops/s (2.62×)
Lettuce 7.9 (Epoll TCP)259,024 ops/s

Cyan-to-violet bars: Zettuce over RDMA. Violet-to-magenta bars: Zettuce over plain TCP (io_uring). Green bars: Lettuce 7.9.0.RELEASE over Netty 4.2.17 Epoll TCP.

All benchmark charts & C / Rust / Python results

Try it in your language

Pick your preferred language once—every code tab across the site and documentation remembers your choice automatically.

import ai.intellistream.zettuce.*;
import java.time.Duration;

// AUTO tries RDMA on port 6379 and falls back cleanly to TCP (io_uring / epoll) on 6380.
RdmaConnectionOptions opts = RdmaConnectionOptions.builder()
        .transport(RdmaConnectionOptions.Transport.AUTO)
        .tcpFallbackPort(6380)
        .auth("my-secret")
        .respVersion(3)
        .database(0)
        .clientName("orders-service")
        .build();

try (ValkeyRdmaConnection conn = Zettuce.connect("10.99.99.41", 6379, opts)) {
    conn.set("order:42", "confirmed");
    String status = conn.get("order:42");

    // Pipeline multiple commands in ONE RDMA doorbell or ONE TCP write
    ValkeyRdmaBatch batch = conn.batch();
    batch.get("order:42");
    batch.ping();
    var replies = batch.execute();

    System.out.println("transport=" + conn.activeTransport() + " metrics=" + conn.metrics());
}

Zero dependencies beyond JDK 22+. Run with --enable-native-access=ALL-UNNAMED.

use zettuce::{Client, RdmaOptions};

fn main() -> zettuce::Result<()> {
    // AUTO tries RDMA on 6379, falling back to Linux io_uring / epoll TCP on 6380.
    let opts = RdmaOptions::auto(6380)
        .with_password("my-secret")
        .with_resp_version(3)
        .with_client_name("orders-service");

    let mut conn = Client::with_options("10.99.99.41", 6379, opts).connect()?;
    conn.set("order:42", "confirmed")?;
    let status = conn.get("order:42")?;

    let mut batch = conn.batch()?;
    batch.get("order:42")?;
    batch.ping()?;
    let replies = batch.execute()?;

    println!("transport={:?} status={:?} metrics={:?}",
             conn.active_transport(), status, conn.metrics()?);
    Ok(())
}

Zero runtime crate dependencies—statically links the C11 zettuce-c engine (no separate .so required; opt-in ZETTUCE_LIB_DIR override).

from zettuce import ValkeyRdmaClient, RdmaOptions

# AUTO tries RDMA on 6379, falling back to io_uring / epoll TCP on 6380.
opts = RdmaOptions(
    transport=RdmaOptions.auto(6380).transport,
    tcp_fallback_port=6380,
    password="my-secret",
    resp_version=3,
    client_name="orders-service",
)

with ValkeyRdmaClient("10.99.99.41", 6379, opts).connect() as conn:
    conn.set("order:42", "confirmed")
    status = conn.get("order:42")

    # C-side pipelined batch (releases the GIL on every round-trip)
    batch = conn.batch()
    batch.get("order:42").ping()
    replies = batch.execute()

    print("transport=", conn.active_transport, "metrics=", conn.metrics())

Native CPython METH_FASTCALL C-extension statically linked against zettuce-c (no separate .so required), releasing the GIL + full asyncio support.

#include <stdio.h>
#include "valkey_rdma_resp.h"

int main(void) {
    char err[256] = {0};
    /* AUTO tries RDMA on 6379, falling back to io_uring / epoll TCP on 6380. */
    valkey_rdma_engine_t *eng = valkey_rdma_engine_connect_ex(
        "10.99.99.41", 6379, NULL, 1024 * 1024,
        5000, 5000, 0, 50,
        VALKEY_TRANSPORT_AUTO, 6380, err, sizeof(err));
    if (!eng) { fprintf(stderr, "connect failed: %s\n", err); return 1; }

    valkey_rdma_cmd_set(eng, "order:42", 8, "confirmed", 9, 0, 0);

    const void *val = NULL;
    uint32_t vlen = 0;
    if (valkey_rdma_cmd_get(eng, "order:42", 8, &val, &vlen) == 1) {
        printf("value=%.*s transport=%d\n",
               (int)vlen, (const char *)val, valkey_rdma_engine_transport(eng));
    }
    valkey_rdma_engine_close(eng);
    return 0;
}

Compile with cc -std=c11 -O3 -Izettuce-c/include app.c -Lzettuce-c/build -lvalkey_rdma_ffm.

  1. Build all four clients in one command on Linux (requires libibverbs-dev / rdma-core-devel headers to compile from source; RDMA runtime libraries are optional if you only need TCP):
    git clone https://github.com/IntelliStream-DataHub/zettuce.git
    cd zettuce && make
  2. Run the verification suite (C, Java, Rust, Python, 100k RESP fuzzer, Jepsen chaos, and ASan/UBSan):
    make test
    make -C zettuce-c check-asan
  3. Connect to Valkey or Redis over RDMA, TCP, Unix domain sockets, or AUTO. The clients guide covers pools, Cluster, Pub/Sub, Sentinel, and metrics in every language.