ValkeyLargeObj Large-Object Module: TSC Alignment
For the Valkey Core Team Sync (weekly Monday sync), 2026-09-21. This is an alignment document, not a full feature proposal. It asks the TSC to align on two architecture points, and to agree on one coordination item, for the ValkeyLargeObj large-object module. Implementation status, provider mechanics, buffer sizes, and test plans are out of scope for this alignment issue.
Purpose
ValkeyLargeObj is a Valkey module for large opaque objects, such as KV-cache tensors, embeddings, and blobs. The goal is to host the module in the valkey-io namespace, with AWS as the sponsor and the maintainer. The valkey-io namespace matters for a specific reason. It makes the module an official, vendor-neutral part of Valkey that is not tied to EFA, to AWS, or to another provider. AWS builds the first adapter and maintains the project, and any other RDMA provider can add an adapter and use the same module. This community hosting is a goal that the TSC must still approve. It is not a decision that exists today. The module needs two capabilities to succeed, and this document asks the TSC to align on the architecture for each. The first capability is high-bandwidth transfer of large objects between client memory and the server. The module gets this through a one-sided RDMA data path. The second capability is lower storage cost for large objects. If the module keeps all object bytes in DRAM, the memory cost per node is too high, so the module needs local storage below DRAM to hold the bytes at lower cost. The two alignment points below follow from these two capabilities. Point 1 covers the RDMA API model. Point 2 covers the local storage and tiering boundary for V1. Each point keeps a Proposal, a Why, and a Concerns and Response part. A scope table and the TSC asks follow.
Point 1: Transport-independent RDMA API model
Proposal
ValkeyLargeObj splits a large-object transfer into two paths. Standard RESP commands form the control path. A separate one-sided RDMA path carries the object bytes out of band. The server, through the module, starts every byte transfer. The client passes its memory descriptors as request data on the command. A descriptor gives the remote key (rkey) and the memory address (remote_addr). The current commands are these:
| Command | Arguments | Behavior |
|---|---|---|
| LO.HELLO | <client_rdma_endpoint> |
Registers the client endpoint. Returns the server endpoint data. |
| LO.GET | <key> <rkey> <remote_addr> |
Blocks the RESP client. The server does a one-sided write of the object into client memory. Returns the byte count. |
| LO.SET | <key> <len> <rkey> <remote_addr> |
Blocks the RESP client. The server does a one-sided read of len bytes from client memory, then stores the object. Returns OK. |
The endpoint bytes are provider-specific and opaque. The API model, the descriptor fields, and the completion semantics are provider-independent. The module reports the command as complete only after the byte transfer completes, and it reports a transfer failure as a command error. Each adapter maps its provider completion events to these semantics. Provider code sits behind a transport adapter that the module owns. AWS EFA is the first adapter. EFA is not part of the API contract. The model must support other RDMA providers through new adapters.
GET control flow:
- The client sends LO.GET on the RESP connection with the key, the rkey, and the remote_addr.
- The module finds the object metadata in the keyspace on the main thread.
- The module blocks the RESP client through the existing blocked-client API and returns no immediate reply. The Valkey main thread continues to serve other clients.
- A module thread reads the object bytes from cache or file storage, then does a server-initiated one-sided write into client memory at remote_addr.
- After the write completes, the module unblocks the client and returns the byte count.
SET control flow:
- The client sends LO.SET on the RESP connection with the key, the len, the rkey, and the remote_addr.
- The module blocks the RESP client through the existing blocked-client API and returns no immediate reply. The Valkey main thread continues to serve other clients.
- A module thread takes a registered buffer, then does a server-initiated one-sided read of len bytes from client memory at remote_addr.
- The module stores the object in file storage, and in the DRAM cache when applicable.
- After storage completes, the module unblocks the client and returns OK.
In both flows, the module blocks only the RESP client. The Valkey main thread is free while storage and RDMA run on module threads. The object bytes never travel in the RESP reply. The final RESP reply only unblocks the client and reports the result.
Why
A normal RESP reply copies the payload through the socket buffer and through server memory more than one time. This cost grows with the object size. A one-sided RDMA transfer moves the bytes directly between client memory and a registered server buffer, so it removes the socket copy for the object. The control path stays on standard commands, so the client keeps normal Valkey authentication and request framing for the control message.
The server starts each transfer, and the client does not pull the data itself. The module knows when the storage or cache data is ready and when its registered buffers are ready. It controls the buffer lifetime and the backpressure. It acknowledges the command only after the transfer completes. A client-pull model would expose the server memory descriptors to the client. It would also make readiness and lifetime coordination part of the public API. Server initiation keeps that coordination inside the module.
Valkey already has RDMA support in src/rdma.c, but it does not meet this need. That code is a connection transport for the RESP byte stream. It moves RESP bytes over its own negotiated ring buffers. Its one-sided operations are internal to that stream transport and target those ring buffers. The receiver then copies from the ring into the RESP path. It does not place a payload one-sided, per command, into arbitrary client memory such as GPU VRAM, and the payload still enters the RESP buffer and copy path. So the module needs its own RDMA data path.
Concerns and Response
Concern: the server acts on a client-supplied key and address, so the transfer trusts client input.
Response: the descriptor is request data. Server initiation moves the trust boundary. It does not remove it. V1 defines the transfer-authorization model, and this is not an open item. A client may start LO.GET or LO.SET only when its authenticated Valkey connection has ACL permission for that command and for the target key. ACL stays the authority for the command and the key. The client may then transfer to or from any memory region for which it supplies a valid RDMA endpoint or session, an address, and an rkey. Possession of the valid descriptor is the intended memory-access capability, and V1 does not add a separate memory-ownership identity check. The RDMA provider and the NIC enforce the registered region bounds, so a transfer cannot read or write outside the registered region. LO.HELLO binds the endpoint and session setup to the current RESP connection, but it does not grant Valkey key access. This model does not assume TLS.
The server also must not write past the client buffer on a GET, because LO.GET carries no length. The V1 model assumes that the client has enough free registered memory to hold the full object before LO.GET starts. To support this assumption, the design must define the supported object-size limit and how the client learns or validates the required capacity. The team must resolve the object-size limit and the capacity check before launch. Chunked or ranged transfer is a later effort, not a V1 requirement.
Concern: does the control path need a session, or can it stay stateless?
Response: V1 uses LO.HELLO to establish a per-client session and to exchange endpoints. A later stateless variant could carry the client endpoint on each command instead. That choice changes the control-path arguments, but not the two-path model, so V1 keeps the session and defers the question.
Point 2: Local storage and tiering boundary
Proposal
ValkeyLargeObj stores each large object in local storage below DRAM, so a node does not hold every object byte in DRAM. The proposed V1 architecture uses one filesystem file per large object. The file is the authoritative copy of the object. DRAM is a cache above the file. A GET may serve the object from the file and may cache file data in DRAM, but the authoritative object does not move between tiers. ValkeyLargeObj is purpose-built for individual large objects, and a client reaches each object only through the explicit LO.* commands. The module does not provide broadly transparent tiering across all Valkey values. This narrow scope is the reason V1 uses a separate storage and tiering engine from the general Valkey Data Tiering effort. The reason for the separate engine is that the storage implementation and semantics differ, not that the module and core boundary differ.
Why
RFC 27 targets smaller objects. General Data Tiering serves ordinary values, and its default backend is a log-structured FlashCache over a fixed-capacity backing file with background reclamation. This design fits ordinary values well. Large objects fit this log-structured cache poorly, because large records make log space management and reclamation less suitable. RFC 27 does not state a byte threshold and lists size as one policy attribute only, so the smaller-value target is an inference from the design, not a stated fact.
For this reason, ValkeyLargeObj uses one filesystem file per large object. The file is the authoritative copy, and DRAM holds an optional cache copy above the file. When ValkeyLargeObj drops the DRAM copy, it does not write the object to disk, because the file already exists. This behavior reduces implementation and eviction complexity, because the engine never needs a spill-and-promote path for the authoritative bytes. The general Data Tiering backend instead spills the authoritative value from DRAM to the file and later promotes it back into DRAM, so DRAM holds the authoritative value when the key is hot. The two engines therefore differ in the source of truth, the on-disk layout for large files, the cache behavior, the failure and recovery path, and the delete path.
With one filesystem file per large object, the authoritative object stays in one disk file, even while DRAM can hold an additional cache copy. The planned nodes have about a 100:1 NVMe-to-DRAM capacity ratio, which makes this concurrent disk-and-DRAM copy acceptable for V1. For these reasons, V1 uses a separate storage and tiering engine for large objects. The team will reevaluate this separate-engine decision as general Data Tiering matures, and the two designs can improve or converge later.
The module and core boundary is a supporting fact for V1. ValkeyLargeObj holds object metadata in a module data type and uses existing module APIs, which are the data-type API, the command API, the allocator API for memory accounting, and the blocked-client API for off-thread transfers. So V1 needs no new Valkey-core execution hook and no new public core API. This boundary keeps V1 low-risk, and it supports the hosting goal, because a module with no new core hook is easy for the valkey-io namespace to host and for AWS to maintain. It is a supporting fact, not the reason for the separate tiering engine.
Concerns and Response
Concern: two tiering designs in Valkey duplicate effort.
Response: the designs share structure, because both keep the key in the keyspace and place the value in a lower tier. ValkeyLargeObj recommends convergence at the vocabulary and at the abstract lifecycle and interface seams: async get, put, and delete, plus completion, capacity, statistics, and snapshot or recovery hooks. ValkeyLargeObj recommends a joint interface study for these seams. It defers a shared ABI and a shared storage layout until both designs mature, because RFC 27 is Proposed only and the storage layouts differ today.
Concern: will ValkeyLargeObj need a core hook later?
Response: it can, if a later version adds byte persistence, replication, or transparent interception. V1 does not add these, so the team can revisit the boundary if the scope changes.
V1 and Deferred Scope
| Item | V1 or deferred | Note |
|---|---|---|
| Two-path model: RESP control path plus one-sided RDMA data path | V1 | n/a |
| Module starts the transfer. GET writes client memory, SET reads client memory | V1 | n/a |
| Client memory descriptors as request data | V1 | n/a |
| Transport adapter that the module owns | V1 | n/a |
| EFA as the first adapter | V1 | Not part of the API contract |
| Other RDMA providers | Deferred | Each provider needs a new adapter |
| File-per-object storage, file authoritative, DRAM as cache | V1 | Proposed architecture |
| Metadata as a module data type, and no new core hook or public core API | V1 | n/a |
| Shared vocabulary and interface seams with Data Tiering | V1 | Reference, then joint study |
| Shared storage ABI and layout with Data Tiering | Deferred | Both designs must mature first |
| Client holds the full object in free registered memory before GET | V1 | Assumed V1 model |
| Supported object-size limit and client capacity check | V1 | Must define before launch |
| Chunked or ranged transfer | Deferred | Later effort, not a V1 requirement |
| Transfer authorization: ACL for command and key, valid RDMA descriptor for memory | V1 | Descriptor possession is the memory-access capability |
| Control-path session or stateless choice | Deferred | Does not change the model |
| Byte persistence, replication, core eviction | Deferred | Out of V1 scope |
TSC Asks
The module owner asks the TSC to align on two architecture points and to agree on one coordination item.
Architecture ask 1: align on the transport-independent RDMA API model in Point 1. This covers the two paths, the module-initiated transfer, the client memory descriptors as request data, the provider code behind a module-owned adapter, and EFA as the first adapter rather than part of the contract. V1 assumes that the client holds the full object in free registered memory before LO.GET starts. The design must define the supported object-size limit and how the client learns or validates the required capacity, and the team must resolve both before launch. V1 also defines the transfer-authorization model. ACL permission on the authenticated connection authorizes the command and the target key, and a valid RDMA endpoint or session, address, and rkey authorizes the memory access. This is a V1 position, not an open item.
Architecture ask 2: align that ValkeyLargeObj V1 uses a separate storage and tiering engine, justified by the storage semantics in Point 2 (a file source of truth with DRAM as a cache, versus DRAM as source of truth with spill and promote), and that V1 needs no new core execution hook and no new public core API because the module uses a module data type and existing module APIs.
Coordination item: agree to a shared storage vocabulary and to abstract lifecycle and interface seams with Data Tiering now, agree to a joint interface study next, and defer a shared ABI and storage layout until both designs mature.
Source: valkey-io/valkey