Datum
🪼 - Just "Stream" anything :]
Datum is a Rust stream processing library scaffolded around Ractor actors and a push-based stream abstraction. The compatibility target is Akka/Pekko Streams Typed API shape and behavior, with Rust-native ownership, async, and benchmarking constraints.
Install
Add Datum to your project from crates.io:
Or in Cargo.toml:
[]
= "0.5"
Note: The package is published as
datum-core(the namedatumis taken on crates.io), but the import path staysuse datum::…— the crate's library name isdatum.
To track an unreleased commit instead:
[]
= { = "https://github.com/Aethergrids/Datum", = "v0.5.0" }
Upstream References
- Ractor crate:
0.15.13 - Optional Ractor cluster crate:
0.15.13, enabled with--features cluster - Akka source submodule:
third_party/akka, tracking upstreammainand pinned in this repository at commit58f1f6db2e505e87f5dc115ee9476833872e7ae0 - Latest stable Akka tag observed during setup:
v2.10.18
Feature highlights (v0.5.0)
- Graph cycles —
MergePreferred/Broadcastfeedback loops supported; unbuffered cycles surfaceEventLimitExceededinstead of hanging. - StreamRefs —
StreamRefs::source_ref()/sink_ref(), Ractor-backed one-shot streaming handles for actor/process boundary crossing. - IO adapters —
StreamConverters::as_input_stream/as_output_streambridging Datum streams tostd::io::Read/Write. - Performance — the typed graph executor now covers all major junction shapes and cyclic feedback; nearly every benchmarked hot path meets or beats warmed Akka/Pekko (see benchmark tables linked below for honest per-row numbers, including below-parity rows).
#![forbid(unsafe_code)]on thedatumcrate itself; new safe depscrossbeam-queueandarc-swaphandle lock-free queues and hub snapshots without adding unsafe to the crate.
Development
use ;
let sum = from_iter
.map
.filter
.run_with
.unwrap
.wait
.unwrap;
Benchmarks
Datum is benchmarked head-to-head against warmed Akka/Pekko Streams across seven areas — Source/Flow,
materialization, graph/junctions, actor ask, dynamic streams, streaming IO, and substreams. As of
v0.5.0, Datum is at or above Akka on the large majority of benchmarked paths. Honest per-path numbers
(including remaining below-parity rows) are in the result tables under roadmap/benchmarks/. The
harness adds a Datum CPU us/op column on purpose: some wins come partly from busy-spinning while
Akka parks — a real cost the wall-clock number hides.
Qualitative summary of the current state:
- Fused linear path: 13–44x Akka (typed plan; all common sink shapes).
- Junctions: 1–340x, with most shapes well above parity; typed kernels now cover concat, merge, broadcast/zip, balance/merge, partition, prioritized merge, merge-preferred, merge-sorted, merge-sequence, and merge-latest.
- Graph cycles (typed feedback kernel): ~29x Akka on the
MergePreferred/Broadcastfeedback shape. - BidiFlow: 3.7–5x Akka.
- Dynamic hubs: MergeHub p16 13x, p4 2.1x (p1 below parity — remaining lever documented in
roadmap/benchmarks/dynamic-streams.md); BroadcastHub 1.3–2x; PartitionHub 1.4–2.7x. - Bounded queue: ~parity (0.96x wall) with ~112x less allocation than Akka.
- map_async: ≥2x at p4/p32 (Tokio dispatch).
- flat_map_merge: 1.4–1.8x.
- Streaming IO adapters: ~7.4x on the round-trip scenario.
- StreamRefs: 0.24–0.26x (Ractor-bound; levers documented).
- Actor ask: ~1.3x at p1; allocation dominated by upstream Ractor boxing (~848 B/element, upstream-blocked).
- Materialization: at parity.
Run a comparison (requires a JDK + sbt); each runner writes a rendered table under target/<area>-comparison/:
Current result tables, the per-operator coverage matrix, and apples-to-apples caveats:
roadmap/benchmarks/source-flow.mdroadmap/benchmarks/materialization.mdroadmap/benchmarks/graph.mdroadmap/benchmarks/actor-ask.mdroadmap/benchmarks/dynamic-streams.mdroadmap/benchmarks/streaming-io.mdroadmap/benchmarks/substreams.mdroadmap/M1-v0.1.0-foundation.md— coverage matrix, optimization status & apples-to-apples caveatsroadmap/M4-v0.4.0-completeness-hardening.md— M4 work packages and exit criteria
See roadmap/ for the full milestone roadmap. User documentation is the published VitePress site (Cloudflare Pages); docs/ holds its source. roadmap/ holds internal planning and benchmark records.