pub struct StoreConfig {
pub backend: StoreBackend,
pub url: Option<String>,
pub owned_shards: Vec<usize>,
pub data_dir: Option<String>,
pub shard_count: usize,
pub cluster: Option<ClusterConfig>,
}Expand description
Event-store backend configuration from [store].
Fields§
§backend: StoreBackendSelected backing store implementation.
url: Option<String>Backend URL/path. For libSQL this is the embedded database path; for memory it is ignored.
owned_shards: Vec<usize>Static distribution-shard assignment for this node (multi-shard active-active). When empty (the default) the node owns ALL shards — the single-node default, byte-identical to today. When set, the engine boot path scopes recovery and enumeration to exactly these shards. Single-shard backends (memory, libSQL) ignore the assignment; it is meaningful only for a sharded backend. No election is performed: assignment is static config.
data_dir: Option<String>Filesystem data directory for the haematite backend. Required when
backend = haematite; ignored by every other backend. The directory is
opened if it already holds a haematite database, otherwise created.
shard_count: usizeNumber of haematite shards to create on a fresh database. Defaults to 64.
This is an IMMUTABLE virtual-shard count: nodes own shard ranges and
routing is BLAKE3(key) % shard_count with no reshard path, so a
single-node deployment can later grow into a cluster WITHOUT a data
migration — but only up to shard_count nodes, and the value is fixed
at create.
The default was briefly 4096 on the premise that lazy shard-actor
materialization (haematite >= 0.4.0) made a high count ~free. That
premise fails in practice (#187): aion-server’s boot restores
packages/routes/namespaces via full-prefix scans, which materialize
EVERY shard, and haematite 0.4.0 then fans each commit out to every
materialized shard with an unconditional fsync — ~2 fsyncs x 4096 per
logical commit — blowing the 5s shard-actor timeout and bricking
deploy/start/timers/outbox on a fresh server. Re-raise only after
haematite makes commit O(dirty shards) and the scaffold e2es pass at
the new default. Set explicitly (config or AION_STORE_SHARD_COUNT)
to override. Ignored by every other backend, and ignored when opening
an existing haematite database (the on-disk shard count wins).
cluster: Option<ClusterConfig>Optional distributed-cluster membership for the haematite backend (SS-2).
Absent (the default) selects the SINGLE-NODE haematite path, byte-identical
to today: no endpoint is bound, no shard is elected, the store owns
everything locally. Present selects the DISTRIBUTED path: the boot path
binds a replication endpoint, builds a quorum membership from members +
peers, and the engine boot path elects (acquire_shard_and_serve) this
node’s owned_shards before recovery. Ignored by every non-haematite
backend.
Trait Implementations§
Source§impl Clone for StoreConfig
impl Clone for StoreConfig
Source§fn clone(&self) -> StoreConfig
fn clone(&self) -> StoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StoreConfig
impl Debug for StoreConfig
Source§impl Default for StoreConfig
impl Default for StoreConfig
Source§impl<'de> Deserialize<'de> for StoreConfigwhere
StoreConfig: Default,
impl<'de> Deserialize<'de> for StoreConfigwhere
StoreConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for StoreConfig
impl RefUnwindSafe for StoreConfig
impl Send for StoreConfig
impl Sync for StoreConfig
impl Unpin for StoreConfig
impl UnsafeUnpin for StoreConfig
impl UnwindSafe for StoreConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request