Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dyniak (Riak PBC / HTTP)

The dyniak data store is the built-in, Riak-compatible backend. It is gated behind the riak Cargo feature and serves two client wire surfaces against the same in-process, transactional Noxu environment:

  • Riak Protocol Buffers Client (PBC) -- the binary protocol, with [4-byte BE length][1-byte msg-code][prost body] framing.
  • HTTP gateway -- the same operations over GET / PUT / POST / DELETE, negotiating application/x-protobuf, application/json, or application/cbor per request.

The implementation lives in the dyniak crate. For the operator walk-through (building, listeners, AAE, 2i storage layout, bucket properties) see Riak mode. This page is the protocol-surface summary.

PBC message surface

Ping, ServerInfo, Get, Put, Del, GetBucket, SetBucket, ListBuckets, ListKeys, Index (2i), and MapRed, plus the Dynomite cluster-admin extensions (DynListPeers, DynClusterJoin / Leave / Plan / Commit, DynAaeStatus). ListBuckets and ListKeys are chunked into a multi-frame stream.

HTTP routes

MethodPathOperation
GET/HEAD/pingLiveness probe.
GET/statsServer stats.
GET/buckets?buckets=trueList buckets.
GET/HEAD/buckets/{b}/keys/{k}Fetch an object.
PUT/buckets/{b}/keys/{k}Store an object.
POST/buckets/{b}/keys/{k}Store an object.
DELETE/buckets/{b}/keys/{k}Delete an object.
GET/buckets/{b}/keys?keys=trueList keys.
GET/buckets/{b}/propsGet bucket properties.
PUT/buckets/{b}/propsSet bucket properties.
POST/mapredSubmit a MapReduce job.
POST/transactionsCluster-wide multi-key transaction.
POST/buckets/{b}/transactionsBucket-scoped transaction.

The search feature adds index-management and search routes under /buckets/{b}/index/... and /buckets/{b}/search/...; without the feature (or without a registry wired in) those routes reply 501 Not Implemented.

An object carries typed links: pointers to other objects, each a (bucket, key, tag) triple. Over HTTP they ride in the Link header; over PBC they are RpbLink entries inside RpbContent. Links are not walked by a dedicated route -- they are traversed by a MapReduce link phase (see below).

Secondary indexes (2i)

Objects can carry secondary-index entries (integer *_int and binary *_bin). The PBC RpbIndexReq handler answers equality and range queries. The storage layout and a client example are documented in Riak mode.

MapReduce

A MapReduce job is a pipeline of phases submitted over POST /mapred (HTTP) or RpbMapRedReq (PBC). Phase kinds:

  • Map / Reduce -- named functions resolved through the phase registry.
  • Link -- follows object links, optionally filtered by bucket and tag; this is how link-walking is expressed.
  • WasmModule -- invokes a registered Wasm module as a map or reduce phase. Available only when the binary is built with the wasm feature and the module is registered (via riak.wasm_modules: or at runtime); without it, a WasmModule phase returns a WasmNotImplemented error.

When built with the search feature, the dyniak HTTP gateway exposes per-bucket text (substring + approximate-regex) and vector-KNN index management and search. The same FT.* surface is available on the RESP plane; see Valkey (RESP) and the search tutorial.

Transactions and causality

dyniak extends Riak's per-key model with atomic multi-key transactions and tracks per-key causality with an Interval Tree Clock. See Dyniak features for cross-node XA transactions and the custom Wasm keyfun, and Riak mode for the ITC context blob.