Expand description
DDS Durability-Service storage abstraction (DDS 1.4 §2.2.3.4/§2.2.3.5).
Crate zerodds-durability-store. Safety classification: STANDARD.
This crate is the storage layer of the standalone Durability-Service
(ADR 0009). It is deliberately free of any DDS/RTPS dependency — the
daemon (zerodds-durability-service) and adapters
(zerodds-durability-store-{sqlite,file,lakehouse}) build on top of it.
§Layering (ADR 0009)
TieredStore — memory hot-cache (bounded by a byte budget) over any cold store
└─ DurabilityStore (this trait) — store / query / unregister / cleanup / stats
└─ cold adapter (sqlite / file / lakehouse / in-memory)§Invariants (normative, ADR 0009)
- The QoS is the contract.
Contract(derived fromDurabilityServiceQosPolicy+ history) is the ONLY thing that bounds retention. The cold store enforces it (drop-oldest /OutOfResources). - The memory budget is not a retention knob.
TieredStore’s hot cache only decides how much contracted history is kept hot in RAM; the rest lives in the cold store and is streamed on read — never capped. - The cold store is authoritative for the full contracted history.
Reads (
DurabilityStore::query) are paginated (Page/Cursor), never “everything into RAM”.
Structs§
- Contract
- Retention contract for a topic, derived from its
DurabilityServiceQosPolicy. The cold store MUST enforce exactly this and nothing tighter (the memory budget is a separate, non-retention knob). - Durability
Sample - A stored durability sample. The
(instance_key, sequence)pair is the stable ordering key within a topic. - InMemory
Store - In-memory, contract-bounded durability store. Thread-safe via a single
mutex. Used directly as the
TRANSIENTcold store, and as the hot tier insidecrate::TieredStore. - Page
- One page of a paginated
crate::DurabilityStore::queryresult. Samples are ordered by(instance_key, sequence).nextisSomewhen more samples may follow — feed it back viaSelector::after_cursor. - Selector
- A read selector for
crate::DurabilityStore::query. All filters are optional and combine with AND.after+limitdrive pagination. - Store
Stats - Aggregate counters for a topic (diagnostics, limit accounting, tiering).
- Tiered
Store - A memory hot-cache over a cold
DurabilityStore. The hot budget is per-topic, in bytes of payload.
Enums§
- Store
Error - Errors surfaced by a
crate::DurabilityStore.
Traits§
- Durability
Store - A durable, contract-bounded sample store. Implementations are the cold
adapters (sqlite / file / lakehouse / in-memory). All methods are
&self+Send + Sync: the daemon shares one store across threads.