The wire and Redis compatibility
Structures speaks RESP2 and RESP3, the Redis protocol, over a raw TCP socket.
redis-cli connects to it. So do the standard Python, Node, Go and Java client
libraries, unchanged.
That is the adoption argument in one line: keep your clients, keep your command vocabulary, and gain everything a cache does not give you.
What a client gets
| Property | Detail |
|---|---|
| RESP2 and RESP3 | Both protocol generations, selected with HELLO |
| Per-connection registration | Client state is registered once per connection, not per command, so transactions, watches and protocol state persist across a session the way a Redis client expects |
| Cluster semantics | The Redis Cluster model: CRC16 over 16,384 slots, {hashtag} co-location for related keys, and MOVED and CROSSSLOT responses |
| KeyDB extensions | Three commands beyond baseline Redis, enumerated below |
| Scripting | Server-side scripting with SHA-based caching and function libraries |
| Pub/sub and keyspace notifications | Channel, pattern and sharded pub/sub, with an in-process dispatcher, a keyspace notifier, and cross-cell fan-out for sharded channels |
The cluster semantics matter more than they look. A client library that already
understands MOVED will follow a redirect to the owning cell without special
handling, which is what makes multi-cell placement transparent to an application
that was written against Redis Cluster.
What a Redis client can and cannot do
The useful question is not "is it Redis-compatible" but "where is the ceiling". Here is the explicit picture.
Supported commands and types
The engine registers over 360 type commands, plus the connection and server commands a client library needs to function. The coverage is wide.
| Area | Covered |
|---|---|
| Core types | Strings, hashes, lists, sets and sorted sets, with their full command families including the blocking list and sorted-set pops (BLPOP, BLMOVE, BZPOPMIN and relatives) |
| Streams | The full stream surface including consumer groups: XADD, XREAD, XRANGE, XREADGROUP, XACK, XCLAIM, XAUTOCLAIM, XPENDING, XGROUP, XINFO, XTRIM |
| Bitmaps and HyperLogLog | SETBIT, BITCOUNT, BITFIELD, BITOP, BITPOS; PFADD, PFCOUNT, PFMERGE |
| Geospatial | GEOADD, GEODIST, GEOSEARCH, GEOSEARCHSTORE and relatives |
| Generic key commands | DEL, EXISTS, the EXPIRE and TTL families, TYPE, SCAN, KEYS, RENAME, COPY, OBJECT, TOUCH, UNLINK, RANDOMKEY, DBSIZE |
| Transactions | MULTI, EXEC, DISCARD, WATCH, UNWATCH |
| Scripting | EVAL, EVALSHA, SCRIPT, FUNCTION, FCALL |
| Pub/sub | SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, PUNSUBSCRIBE, the sharded family SSUBSCRIBE, SPUBLISH, SUNSUBSCRIBE, and PUBSUB including SHARDCHANNELS and SHARDNUMSUB, plus keyspace notifications |
| Connection and server | PING, ECHO, HELLO, SELECT, AUTH, QUIT, RESET, CLIENT, COMMAND, CONFIG, SLOWLOG, INFO, SAVE, BGSAVE, LASTSAVE, CLUSTER, WAIT, WAITAOF |
| Redis Stack module surface | The same command namespaces the Redis Stack modules use: JSON documents (JSON.*), search and indexing (FT.*), time series (TS.*), and the probabilistic sketches (BF.*, CF.*, CMS.*, TOPK.*, TDIGEST.*) |
| System9 type families | Commands with no Redis equivalent, for the types that extend past the Redis surface: vectors (VADD, VSIM), tensors, dataframe structures (FRAME.*), graphs (GRAPH.*), the CRDT family (CRDT.*), Merkle logs, bitemporal records, intervals, trees, roaring bitmaps, HyperMinHash and DDSketch |
The KeyDB extensions
Beyond baseline Redis the engine implements three KeyDB commands, and these are the whole set, not an open-ended "and more":
| Command | What it does |
|---|---|
OBJECT LASTMODIFIED key | Seconds since the key was last written, or -1 if it does not exist |
BITOP LSHIFT key n | Left bitwise shift of the string value by n bits, in place |
BITOP RSHIFT key n | Right bitwise shift of the string value by n bits, in place |
The compatibility ceiling
A standard client works unchanged, within these boundaries.
- Authentication is not optional on an authenticated listener. Before a connection authenticates, only
AUTH,HELLO,QUITandRESETare accepted; anything else is refused with-NOAUTH. The connection binds to a verified directory entity, not to a shared password. - Every command is authorized. A command can be denied per command even on a valid, authenticated connection, because it re-enters the engine-boundary authorizer with workspace scope, classification and grants. Vanilla Redis has no equivalent refusal, so a client must handle an authorization error on a command it was allowed to send.
- Subscriber mode is restricted, as in Redis. While a RESP2 connection is in subscriber mode it may issue only the subscribe and unsubscribe commands plus
PING,QUITandRESET. Sharded pub/sub is part of the surface alongside channel and pattern pub/sub:SSUBSCRIBE,SPUBLISH,SUNSUBSCRIBE, withPUBSUB SHARDCHANNELSandSHARDNUMSUBanswered from real state. A sharded-channel publish delivers locally and fans out to the other cells that own the channel's slot, over the same peer transport and replica placement the write path uses, loop-free. Sharded channels occupy a disjoint channel space from regular channel and pattern pub/sub. - Cross-cell sharded pub/sub has two boundaries. Message payloads cross the peer transport UTF-8-decoded, so cross-cell sharded pub/sub is not binary-clean, a pre-existing structure-replication limitation. And the cross-cell fan-out is proven on the in-process multi-cell tier; the live-wire sovereign-corner proof is owed.
WAITblocks on real replica acknowledgment. A per-slot acknowledgment registry tracks which replica cells have acknowledged up to a sequence number, andWAITblocks, bounded by its timeout, until the requested number of replicas have acknowledged, returning the achieved count rather than a canned zero. On a single cell, with no replicas, or for a non-blockable client, it returns the current count immediately rather than hanging.WAITAOF's replica half runs on the same mechanism; its local-durability count reports that a write reached the append-only log, not a per-write fsync-to-checkpoint confirmation, and a precise per-write fsynced offset is owed. The engine's own log and replication path are described in Persistence and distribution.CONFIGis a bounded parameter set. The server answers a defined allowlist of parameters (includingmaxmemory,maxmemory-policy, theslowlog-*pair,appendonlyandnotify-keyspace-events), not the entire Redis configuration surface.- Protocol limits are hard and Redis-shaped. A request is capped at 1,048,576 multibulk elements and 512 MiB per bulk string. A malformed frame closes the connection with a typed protocol error rather than being silently dropped.
The wire is not an authorization bypass
This is the property that makes the compatibility safe to offer, and it is the first question a security reviewer should ask.
A standard Redis client connecting directly does not find an ungoverned back door:
- The connection is deny-by-default until it authenticates.
- The connection binds to a verified directory entity, not to a shared password.
- Every command re-enters the same engine-boundary authorizer the HTTP surface uses.
So a GET over RESP is subject to the same workspace scope, the same
classification and the same grants as the equivalent call over HTTP. The protocol
determines the syntax, not the authority.
Figure: the Redis wire, governed. Connecting is not authorization. The connection authenticates and binds to a directory entity, and then every command crosses the same authorizer an HTTP caller crosses.
Other ways in
The wire is the compatibility surface, not the only one.
| Surface | For |
|---|---|
| RESP2 / RESP3 | Existing Redis clients and tooling |
| An external HTTP face | Credential-authenticated callers that do not speak RESP |
| An in-process workspace client | Co-located callers inside the cell, including agents |
| An operator surface | Browsing and administering structures from the console |
| Agent tools | Query and execute verbs exposed to a reasoning agent, including on a disconnected device |
All of them land on the same engine behind the same authorizer.
What you gain over a cache
The same set or sorted set that would sit in an ungoverned cache becomes, here:
- Workspace-scoped, so it belongs to a boundary rather than to a shared namespace.
- Classified, on the same ladder as a table.
- Authorized per command, against real grants.
- Audited, into the same record as everything else.
- Replicated across cells, with conflict-free convergence.
- Metered, so its consumption is attributable.
A cache gives you none of those, which is why a cache is where governance quietly ends in most estates.
Related
- Structures, the type surface and the engine.
- Concurrency and expiry, what happens when two callers touch the same key.
- Distribution and protection, how slots and replicas work across cells.
- Engines and access methods, the wider protocol surface.