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.9"
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.9.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.9.0)
- Concurrency primitives (
datum::concurrent) —Signal<T>(latest-value state cell with a lock-freeget()and a coalesced change feed),Subscription<T>(the same state cell with a lossless every-change feed),Channel<T>(closeable bounded MPSC), andTopic<T>(pub-sub broadcast with backpressure/sliding/dropping overflow policies). Benchmarked 4-way against FS2, ZIO, and Akka: every row beats the best JVM competitor on both wall-clock and CPU. - API ergonomics (additive, zero semantic change) —
use datum::prelude::*;, terminal shortcuts (run_fold/run_foreach/run_reduce),(0..n).into_source()/Source::from(vec), the graph wiring DSLbuilder.wire(a.to(&b))(withconnect()still first-class), and idiomatictry_*fallible operators (try_map,try_filter, … —*_resultnames deprecated). - Complete Akka Streams surface — the linear DSL, GraphDSL with typed junctions and cycles,
substreams, dynamic streams (kill switches, hubs), StreamRefs (same-process splice + remote
transport via
datum-net), streaming IO, and IO adapters bridging tostd::io::Read/Write. #![forbid(unsafe_code)]on thedatumcrate itself; lock-free internals come from safe deps (crossbeam-queue,arc-swap).
Development
use *;
let sum =
.into_source
.map
.filter
.run_fold
.unwrap
.wait
.unwrap;
assert_eq!;
Benchmarks
Datum is benchmarked head-to-head against warmed Akka/Pekko Streams across eight core areas —
Source/Flow, materialization, graph/junctions, actor ask, dynamic streams, streaming IO, substreams,
and queues — plus network carriers (datum-net) and a 4-way concurrency-primitives comparison
against FS2, ZIO, and Akka. Honest per-path numbers (including any at-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 a JVM parks — a real cost the wall-clock number hides.
Qualitative summary of the current state:
- Fused linear path: 13–46x Akka (typed plan; all common sink shapes).
- Junctions: 2.3–340x; typed kernels cover all major shapes; graph cycles ~29x.
- Concurrency primitives (vs best of FS2/ZIO/Akka per row): Channel MPSC ×1024 7.5x wall / 20.5x CPU; Signal reads ~ns-class (3.6–7.8x ZIO); Signal propagation ×1024 83x; Subscription lossless ×256 43x; Topic fanout ×1024 23x.
- Remote StreamRefs (forced-remote Akka Artery-TCP, fair): ~9.9x faster wall, ~14.8x lower CPU, ~35x lower allocation; same-process splice ~6.5x.
- Dynamic hubs: MergeHub p16 ~16x (p1 ~0.46x — core materialization floor, documented); BroadcastHub 1.3–2x; PartitionHub 1.4–2.7x.
- Queues: source-queue backpressure ~985x; bounded queue ~parity wall with ~112x less allocation.
- Actor ask: ~2.4–3x at p2–p4; allocation dominated by upstream Ractor boxing (~848 B/element, upstream-blocked).
- Streaming IO adapters: ~7.4x on the round-trip scenario; 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.