pub enum BackendType {
Disk,
InMemory,
}Expand description
Storage backend type — binary choice: disk (persistent) vs memory
(volatile). Replication is a separate axis handled by @distribute;
this enum only says whether the bytes hit disk or stay in RAM.
User-facing values: "memory" or "disk". "disk" is the default
and typically omitted in schema; "memory" is the opt-in for
volatility-tolerant workloads.
The concrete disk engine (RocksDB today; potentially others later)
is an implementation detail the operator doesn’t care about —
hence “disk” rather than naming the engine. Legacy values
"rocksdb" and "distributed" still parse for backward
compatibility; new code should use "disk".
Variants§
Disk
On-disk persistent storage. Engine is a platform detail
(currently sharded RocksDB; swappable without schema changes).
Default; users typically don’t set this explicitly.
InMemory
In-memory HashMap — volatile, fast, no disk. First-class
production option for workloads whose data tolerates
reset-on-crash: rate-limit buckets, session caches, dedup
sets, leaderboards rebuilt from source-of-truth, ephemeral
workflow scratch. ~10x lower write latency than disk, no
fsync tail.
Replication (cross-node state) is handled by the @distribute
directive, which wraps any KvBackend regardless of concrete
type — memory-backed tables can still participate in
replication when explicitly opted in.
Trait Implementations§
Source§impl Clone for BackendType
impl Clone for BackendType
Source§fn clone(&self) -> BackendType
fn clone(&self) -> BackendType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BackendType
Source§impl Debug for BackendType
impl Debug for BackendType
Source§impl Default for BackendType
impl Default for BackendType
Source§fn default() -> BackendType
fn default() -> BackendType
Source§impl Display for BackendType
impl Display for BackendType
impl Eq for BackendType
Source§impl FromStr for BackendType
impl FromStr for BackendType
Source§impl Hash for BackendType
impl Hash for BackendType
Source§impl Ord for BackendType
impl Ord for BackendType
Source§fn cmp(&self, other: &BackendType) -> Ordering
fn cmp(&self, other: &BackendType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BackendType
impl PartialEq for BackendType
Source§fn eq(&self, other: &BackendType) -> bool
fn eq(&self, other: &BackendType) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for BackendType
impl PartialOrd for BackendType
impl StructuralPartialEq for BackendType
Auto Trait Implementations§
impl Freeze for BackendType
impl RefUnwindSafe for BackendType
impl Send for BackendType
impl Sync for BackendType
impl Unpin for BackendType
impl UnsafeUnpin for BackendType
impl UnwindSafe for BackendType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToEcoString for T
impl<T> ToEcoString for T
Source§fn to_eco_string(&self) -> EcoString
fn to_eco_string(&self) -> EcoString
EcoString.