zerodds-durability-store
Services — Durability. Storage abstraction of the Durability-Service for
TRANSIENTandPERSISTENTdurability (OMG DDS 1.4 §2.2.3.4/§2.2.3.5); the architecture follows ADR 0009.
- Source: crates/durability-store
- API docs: docs.rs/zerodds-durability-store
zerodds-durability-store is the storage layer of the Durability-Service. It
depends on no DDS or RTPS crate, only on zerodds-qos. The daemon
(zerodds-durability-service) and the
storage adapters build on it:
TieredStore — memory cache (bounded by a byte budget) over any cold store
└─ DurabilityStore (trait) — store / query / unregister / cleanup / stats
└─ cold adapter (sqlite / file / postgres / lakehouse / in-memory)
The crate docs state three invariants:
- The QoS is the contract.
Contract, derived fromDurabilityServiceQosPolicy, is the only bound on retention. The cold store enforces it: the oldest sample is dropped underKEEP_LAST,StoreError::OutOfResourcesis returned when aKEEP_ALLlimit is reached. - The memory budget does not bound retention.
TieredStoreuses it only to decide how much of the contracted history stays in RAM. Every sample is written through to the cold store; when the per-topic byte budget is exceeded, the samples with the lowest sequence numbers are evicted from RAM only. - The cold store holds the full contracted history.
DurabilityStore::queryreturns pages (Selector,Page,Cursor) ordered by(instance_key, sequence).
Public items: the trait DurabilityStore (set_contract,
set_topic_meta, topic_meta, store, query,
unregister, cleanup, stats,
replay_for_topic); Contract (from_qos,
keep_all); DurabilitySample (topic, 16-byte instance KeyHash,
sequence number, payload, XCDR representation, byte order, creation time, GUID and sequence
number of the source writer); TopicMeta (type name, keyedness, contract);
StoreStats; InMemoryStore (cold store for TRANSIENT
without disk, also the reference for the trait semantics); TieredStore;
StoreError (OutOfResources, Backend,
Poisoned).
Spec anchors
- OMG DDS 1.4 §2.2.3.4 (
DURABILITY), §2.2.3.5 (DURABILITY_SERVICE). - DDSI-RTPS §9.6.4.8 (instance KeyHash, 16 bytes), §10.5 (representation
from the encapsulation header), §8.3.5.4 (sequence number of the source writer), §8.4.2.1
(
type_name), §9.3.1.2 (entityKind, keyedness).
Consumers
zerodds-durability-serviceandzerodds-durability-service-bin.- The storage adapters
zerodds-durability-store-sqlite,zerodds-durability-store-file,zerodds-durability-store-postgresandzerodds-durability-store-lakehouse.
Status
std(usesstd::sync::Mutexandstd::time),#![forbid(unsafe_code)]. Safety classification in the crate docs: STANDARD.- Library only, no binary, no cargo features.
- Test functions in the source: 3 in
src/contract.rs, 13 intests/store_semantics.rs.
zerodds-durability-store
Dienste — Durability. Speicherabstraktion des Durability-Service für Durability
TRANSIENTundPERSISTENT(OMG DDS 1.4 §2.2.3.4/§2.2.3.5); die Architektur folgt ADR 0009.
- Quelle: crates/durability-store
- API-Docs: docs.rs/zerodds-durability-store
zerodds-durability-store ist die Speicherschicht des Durability-Service. Die
Crate hängt von keiner DDS- oder RTPS-Crate ab, nur von zerodds-qos. Der Daemon
(zerodds-durability-service) und die
Speicheradapter bauen darauf auf:
TieredStore — memory cache (bounded by a byte budget) over any cold store
└─ DurabilityStore (trait) — store / query / unregister / cleanup / stats
└─ cold adapter (sqlite / file / postgres / lakehouse / in-memory)
Die Crate-Dokumentation nennt drei Invarianten:
- Die QoS ist der Vertrag.
Contract, abgeleitet ausDurabilityServiceQosPolicy, ist die einzige Grenze der Aufbewahrung. Der Speicher der kalten Ebene setzt sie durch: UnterKEEP_LASTfällt das älteste Sample weg, bei Erreichen einer Grenze unterKEEP_ALLkommtStoreError::OutOfResourceszurück. - Das Speicherbudget begrenzt die Aufbewahrung nicht.
TieredStoreentscheidet damit nur, wie viel der vertraglich gehaltenen Historie im RAM bleibt. Jedes Sample wird bis in die kalte Ebene durchgeschrieben; wird das Byte-Budget eines Topics überschritten, fallen die Samples mit den niedrigsten Sequenznummern nur aus dem RAM. - Die kalte Ebene hält die vollständige vertragliche Historie.
DurabilityStore::queryliefert Seiten (Selector,Page,Cursor), sortiert nach(instance_key, sequence).
Öffentliche Elemente: das Trait DurabilityStore (set_contract,
set_topic_meta, topic_meta, store, query,
unregister, cleanup, stats,
replay_for_topic); Contract (from_qos,
keep_all); DurabilitySample (Topic, 16 Byte KeyHash der Instanz,
Sequenznummer, Nutzdaten, XCDR-Repräsentation, Byte-Reihenfolge, Erzeugungszeit, GUID und
Sequenznummer des Quell-Writers); TopicMeta (Typname, Key-Eigenschaft, Vertrag);
StoreStats; InMemoryStore (kalte Ebene für TRANSIENT
ohne Platte, zugleich Referenz für die Semantik des Traits); TieredStore;
StoreError (OutOfResources, Backend,
Poisoned).
Spec-Anker
- OMG DDS 1.4 §2.2.3.4 (
DURABILITY), §2.2.3.5 (DURABILITY_SERVICE). - DDSI-RTPS §9.6.4.8 (KeyHash der Instanz, 16 Byte), §10.5
(Repräsentation aus dem Encapsulation-Header), §8.3.5.4 (Sequenznummer des Quell-Writers),
§8.4.2.1 (
type_name), §9.3.1.2 (entityKind, Key-Eigenschaft).
Konsumenten
zerodds-durability-serviceundzerodds-durability-service-bin.- Die Speicheradapter
zerodds-durability-store-sqlite,zerodds-durability-store-file,zerodds-durability-store-postgresundzerodds-durability-store-lakehouse.
Status
std(verwendetstd::sync::Mutexundstd::time),#![forbid(unsafe_code)]. Einstufung in der Crate-Dokumentation (safety classification): STANDARD.- Nur Bibliothek, kein Binary, keine Cargo-Features.
- Testfunktionen im Quelltext: 3 in
src/contract.rs, 13 intests/store_semantics.rs.