Expand description
User-facing HydraCache runtime.
HydraCache is local-first: HydraCache::local has no network dependency.
Optional client/member builders add the first cluster API shape on top of
the same local cache and distributed invalidation bus.
§Quick start
use std::time::Duration;
use hydracache::{CacheOptions, HydraCache};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
struct User {
id: u64,
name: String,
}
let cache = HydraCache::local()
.default_ttl(Duration::from_secs(300))
.max_capacity(10_000)
.build();
let user = cache
.get_or_insert_with("user:42", CacheOptions::new().tag("user:42"), || async {
User {
id: 42,
name: "Ada".to_owned(),
}
})
.await?;
assert_eq!(user.id, 42);
cache.invalidate_tag("user:42").await?;§Cacheable functions
Use cacheable_loader! when an ordinary async function or expensive operation
should be cached without introducing database-result-cache concepts.
cacheable_loader! wraps fallible loaders. cacheable_infallible! wraps loaders
that return a value directly.
use std::time::Duration;
use hydracache::{cacheable_loader, cacheable_infallible, HydraCache};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
struct Report {
id: u64,
}
#[derive(Debug)]
struct LoadError;
impl std::fmt::Display for LoadError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("load failed")
}
}
impl std::error::Error for LoadError {}
let cache = HydraCache::local().build();
let report = cacheable_loader!(
cache = cache,
key = "report:42",
tags = ["reports", "report:42"],
ttl = Duration::from_secs(60),
load = || async { Ok::<_, LoadError>(Report { id: 42 }) },
)
.await?;
assert_eq!(report.id, 42);
let total = cacheable_infallible!(
cache = cache,
key = "report-total:42",
tags = ["reports", "report:42"],
ttl_secs = 60,
load = || async { 42_u64 },
)
.await?;
assert_eq!(total, 42);Use CacheKeyBuilder and TagSet when the key and invalidation tags are
generated from the same domain metadata:
use hydracache::{cacheable_loader, CacheKeyBuilder, HydraCache, TagSet};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
struct Profile {
id: u64,
}
#[derive(Debug)]
struct LoadError;
impl std::fmt::Display for LoadError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("load failed")
}
}
impl std::error::Error for LoadError {}
let cache = HydraCache::local().build();
let profile_id = 42_u64;
let key = CacheKeyBuilder::new()
.entity("profile", profile_id)
.build_string();
let profile = cacheable_loader!(
cache = cache,
key = key.as_str(),
tags = TagSet::new().tag("profiles").entity("profile", profile_id),
ttl_secs = 60,
load = move || async move {
Ok::<_, LoadError>(Profile { id: profile_id })
},
)
.await?;
assert_eq!(profile.id, 42);
cache.invalidate_tag("profile:42").await?;Use cacheable when the cached operation is naturally an async function.
The cache remains an explicit argument; the generated wrapper returns
CacheResult because cache errors can occur outside the user loader:
use hydracache::{cacheable, HydraCache};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
struct Profile {
id: u64,
}
#[derive(Debug)]
struct LoadError;
impl std::fmt::Display for LoadError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("load failed")
}
}
impl std::error::Error for LoadError {}
#[cacheable(
cache = cache,
key_segments = ["profile", profile_id],
tag_segments = [["profile", profile_id], ["profiles"]],
ttl_secs = 60
)]
async fn load_profile(
cache: &HydraCache,
profile_id: u64,
) -> Result<Profile, LoadError> {
Ok(Profile { id: profile_id })
}
let cache = HydraCache::local().build();
let profile = load_profile(&cache, 42).await?;
assert_eq!(profile.id, 42);§Typed local cache
use hydracache::{CacheOptions, HydraCache};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
struct User {
id: u64,
name: String,
}
let cache = HydraCache::local().build();
let users = cache.typed::<User>("users");
users
.put(
"42",
User {
id: 42,
name: "Ada".to_owned(),
},
CacheOptions::new(),
)
.await?;
let cached = users.get("42").await?;
assert_eq!(cached.map(|user| user.id), Some(42));§Cache events
Use HydraCache::subscribe when an application, actuator, or sandbox
wants to observe cache mutations without wrapping every call manually.
Access/load events are opt-in because hit/miss streams can be noisy.
use hydracache::{CacheEventKind, CacheOptions, HydraCache};
let cache = HydraCache::local().build();
let mut events = cache.subscribe_mutations();
cache
.put("user:42", 42_u64, CacheOptions::new().tag("users"))
.await?;
let event = events.recv().await.expect("stored event");
assert_eq!(event.kind(), CacheEventKind::Stored);
assert_eq!(event.key(), Some("user:42"));
assert_eq!(event.tags(), &["users".to_owned()]);Callback listeners are adapters over the same subscription stream:
use hydracache::{CacheOptions, HydraCache};
let cache = HydraCache::local().build();
let listener = cache.on_mutation(|event| {
println!("cache changed: {event:?}");
});
cache.put("user:42", 42_u64, CacheOptions::new()).await?;
listener.unsubscribe();Event publication is preflighted before HydraCache builds owned event
payloads. If an event kind is disabled or no active subscriber can receive
it, the cache operation skips the event allocation path. Access events still
require both a subscriber and HydraCacheBuilder::enable_access_events.
use hydracache::{CacheEventKind, CacheOptions, HydraCache};
let quiet_cache = HydraCache::local().build();
quiet_cache
.put("user:42", "Ada", CacheOptions::new().tag("users"))
.await?;
assert_eq!(quiet_cache.stats().events_published, 0);
let observed_cache = HydraCache::local().build();
let mut events = observed_cache.subscribe_mutations();
observed_cache
.put("user:43", "Grace", CacheOptions::new().tag("users"))
.await?;
let event = events.recv().await.expect("stored event");
assert_eq!(event.kind(), CacheEventKind::Stored);
assert_eq!(observed_cache.stats().events_published, 1);§Distributed invalidation bus
Use InMemoryInvalidationBus when several cache instances in one process
should propagate invalidation intent to each other. The bus only sends
invalidate_key, invalidate_tag, remove, and flush operations; cached
values are not replicated.
use std::sync::Arc;
use std::time::Duration;
use hydracache::{CacheEventOrigin, CacheOptions, HydraCache, InMemoryInvalidationBus};
let bus = Arc::new(InMemoryInvalidationBus::default());
let first = HydraCache::local()
.shared_invalidation_bus(bus.clone())
.invalidation_node_id("first")
.build();
let second = HydraCache::local()
.shared_invalidation_bus(bus)
.invalidation_node_id("second")
.build();
first
.put("user:42", 42_u64, CacheOptions::new().tag("users"))
.await?;
second
.put("user:42", 42_u64, CacheOptions::new().tag("users"))
.await?;
let mut events = second.subscribe_tag("users");
first.invalidate_tag("users").await?;
// Remote invalidation is applied by a background task, so applications that
// need to observe it immediately should wait on events or diagnostics.
let event = tokio::time::timeout(Duration::from_millis(500), events.recv())
.await
.expect("remote invalidation event")
.expect("subscription stays open");
assert_eq!(event.origin(), CacheEventOrigin::DistributedBus);
assert!(!second.contains_key("user:42").await);
// Runtime counters expose the same path for diagnostics and metrics.
let _publisher_stats = first.stats();
let _receiver_stats = second.stats();InMemoryFramedInvalidationBus is a transport spike for cross-process
adapters. It serializes each message into CacheInvalidationFrame bytes
before delivery, so tests can exercise the same encoding boundary future
TCP, Redis, NATS, or Postgres adapters will need.
Custom transports implement CacheInvalidationBus and return
CacheInvalidationReceive::Message, CacheInvalidationReceive::Lagged,
CacheInvalidationReceive::DecodeError, or
CacheInvalidationReceive::Closed from their receivers. HydraCache
records lag, decode errors, publish failures, and closed receivers in
hydracache_core::CacheStats so applications can detect bus health issues
without parsing logs.
§Client and member cluster mode
HydraCache::client creates an application-side near-cache. HydraCache::member
creates an in-process cluster member. In v0.20 both can share an
InMemoryCluster for tests, demos, and embedded applications while the
future discovery/Raft adapters are still being designed. Custom adapters can
implement ClusterDiscovery for discovery/liveness and
ClusterControlPlane for admission/metadata decisions.
ChitchatStyleDiscovery is a dependency-free seed-node discovery spike
that records chitchat-shaped candidates and liveness events without starting
a network runtime.
RaftStyleMetadataControlPlane is a dependency-free metadata-log spike
that records committed membership commands and snapshots without starting a
Raft runtime.
use std::sync::Arc;
use hydracache::{
CacheEventOrigin, CacheOptions, ClusterGeneration, HydraCache, InMemoryCluster,
InMemoryClusterDiscovery,
};
let cluster = Arc::new(InMemoryCluster::new("orders-prod"));
let discovery = Arc::new(InMemoryClusterDiscovery::new());
let member = HydraCache::member()
.cluster("orders-prod")
.shared_cluster(cluster.clone())
.shared_discovery(discovery.clone())
.node_id("member-a")
.generation(ClusterGeneration::new(1))
.bind("127.0.0.1:7000")
.start()
.await?;
let client = HydraCache::client()
.cluster("orders-prod")
.shared_cluster(cluster)
.shared_discovery(discovery.clone())
.node_id("api-client-a")
.bootstrap("127.0.0.1:7000")
.connect()
.await?;
client
.put("user:42", 42_u64, CacheOptions::new().tag("user:42"))
.await?;
let mut events = client.subscribe_tag("user:42");
member.invalidate_tag("user:42").await?;
let event = events.recv().await.expect("subscription stays open");
assert_eq!(event.origin(), CacheEventOrigin::DistributedBus);
assert!(!client.contains_key("user:42").await);
let diagnostics = client.cluster_diagnostics().expect("cluster runtime");
assert_eq!(diagnostics.member_count, 1);
assert_eq!(diagnostics.client_count, 1);
assert!(diagnostics.lifecycle.is_running());
assert_eq!(discovery.candidates().len(), 2);
client.leave_cluster().await?;
assert!(client.cluster_diagnostics().unwrap().lifecycle.is_stopped());§Observability
Use HydraCache::diagnostics for quick local smoke checks. It combines
lightweight stats with the approximate local backend entry count.
use hydracache::{CacheOptions, HydraCache};
let cache = HydraCache::local().build();
let first = cache
.get_or_insert_with("answer", CacheOptions::new(), || async { 42_u64 })
.await?;
let second = cache
.get_or_insert_with("answer", CacheOptions::new(), || async { 7_u64 })
.await?;
let diagnostics = cache.diagnostics().await;
assert_eq!((first, second), (42, 42));
assert_eq!(diagnostics.stats.loads, 1);
assert_eq!(diagnostics.stats.hits, 1);
assert_eq!(diagnostics.hit_ratio(), Some(0.5));Modules§
- testing
- Deterministic staging helpers for HydraCache release gates and sandbox labs.
Macros§
- cacheable_
infallible - Cache an ordinary async loader that cannot fail in application terms.
- cacheable_
loader - Cache an ordinary fallible async loader with explicit local-cache metadata.
Structs§
- AckRequirement
- Acknowledgement requirement computed from a consistency level and effective placement.
- Active
Active Config - Active-active mode configuration for one cache/grid slice.
- Active
Active Config Error - Error returned when active-active is requested without the loud acknowledgement.
- Active
Active State - Deterministic active-active state machine used by release gates and adapters.
- Adaptive
Window - AIMD flow-control window for one backup replication stream.
- Admission
Controller - Admission controller with FIFO backlog.
- Admission
Limits - Admission limits for count, memory and backlog.
- Admission
Permit - Permit returned for admitted work.
- Admission
Queue Ticket - FIFO queue ticket.
- Admission
Snapshot - Admission controller snapshot.
- Anti
Entropy Task - Throttled anti-entropy executor config.
- Applied
Set - Locally applied dependency high-water stamps.
- AtRest
Sealer - At-rest artifact sealer.
- Atomic
Invalidation Error - Error returned by atomic invalidation helpers.
- Auto
Repair Decision - Auto-repair decision.
- Auto
Repair Policy - Policy for operational self-healing.
- Autoscaler
Admission - Accepted autoscaler admission result.
- Autoscaler
Admission Policy - Guardrails used to admit an autoscaler intent.
- Autoscaler
Intent Error - Error returned by autoscaler intent admission.
- Backup
Dataset - Source/restore dataset used by the backup seam.
- Backup
Entry - One manifest entry.
- Backup
Manifest - Full backup manifest.
- Backup
Promotion - Backup promotion operation for one partition.
- Batch
Invalidation State - Deterministic state machine for validating batch atomicity.
- Bounded
Staleness Metrics - Bounded staleness metrics.
- Cache
Diagnostics - User-facing diagnostic snapshot for a local cache instance.
- Cache
Event - Metadata-only cache event.
- Cache
Event Listener Handle - Handle for a callback-style cache event listener.
- Cache
Event Options - Subscription filters for cache events.
- Cache
Event Subscriber - Receiver for cache events emitted by one
HydraCache. - Cache
Invalidation Frame - Binary envelope for invalidation messages that cross a process boundary.
- Cache
Invalidation Message - Invalidation message published on a
CacheInvalidationBus. - Cache
Key - A logical cache key.
- Cache
KeyBuilder - Builder for cache keys made of escaped
:-separated segments. - Cache
Options - Per-entry cache behavior.
- Cache
Stats - Snapshot of lightweight cache counters.
- Capacity
Autoscaler Metrics - Bounded metric snapshot for capacity/autoscaler surfaces.
- Capacity
Sample - One capacity sample consumed by the recommendation engine.
- Capacity
Signal - Structured capacity signal exported by status/metrics.
- Capacity
Thresholds - Tunables for capacity recommendations.
- Causal
Apply Deferred - Error returned when a causal write is not yet visible.
- Causal
Consistency Metrics - Causal consistency metrics.
- Causal
Summary - Bounded causal dependency summary carried by a session write.
- Causal
Write - Session write with attached causal dependency summary.
- Certificate
Bundle - Certificate material tracked during a rotation window.
- Certificate
Rotation Window - Certificate rotation window that accepts current and explicitly retained previous certs.
- Checkpoint
Coordinator - In-memory coordinator for cluster-wide checkpoint collection.
- Checksummed
Replicated Value Record - Durable replicated value record plus checksum metadata.
- Chitchat
Style Discovery - Dependency-free, chitchat-style discovery adapter for tests and API spikes.
- Cluster
Admission Bridge - Polls discovery candidates and admits them into an authoritative control plane.
- Cluster
Admission Bridge Config - Polling behavior for
ClusterAdmissionBridge. - Cluster
Admission Bridge Diagnostics - Lightweight counters for a cluster admission bridge.
- Cluster
Admission Bridge Handle - Handle for a background
ClusterAdmissionBridgepolling task. - Cluster
Cache Counters - Three-part groupcache-style counters for pilot dashboards.
- Cluster
Candidate - Candidate discovered before authoritative membership admission.
- Cluster
Checkpoint Error - Error returned by checkpoint collection, verification, and restore fencing.
- Cluster
Checkpoint Manifest - Cluster-wide consistent cut over durable per-node snapshot manifests.
- Cluster
Component Error - Error returned by a background cluster component.
- Cluster
Diagnostics - Cluster
Discovery Diagnostics - Discovery diagnostics visible from a
HydraCacheclient/member runtime. - Cluster
Endpoints - Cluster
Epoch - Committed cluster metadata epoch.
- Cluster
Fill Counters - Point-in-time owner/remote/hot fill counters for cluster staging.
- Cluster
Generation - Monotonic process generation for a cluster node id.
- Cluster
Grid Counters - Aggregate grid counters; high-cardinality detail stays in diagnostics.
- Cluster
Grid Diagnostics - High-cardinality grid detail kept out of metrics.
- Cluster
Lifecycle Component - Minimal reusable lifecycle component for adapters that already own work.
- Cluster
Lifecycle Diagnostics - Point-in-time lifecycle diagnostics for an embedded cluster component.
- Cluster
Load Report - Structured cluster load report used by deterministic staging gates.
- Cluster
Member - Admitted cluster participant snapshot.
- Cluster
Membership Subscriber - Receiver for cluster membership events from a control plane.
- Cluster
Merge Outcome - Result of applying a merge policy.
- Cluster
Metric Descriptor - Bounded metric descriptor used by cardinality tests and exporters.
- Cluster
Node - IO-free cluster node state machine.
- Cluster
Node Config - Configuration for a sans-IO cluster node.
- Cluster
Node Id - Stable logical id for a HydraCache cluster participant.
- Cluster
Ownership Decision - Cluster
Ownership Diagnostics - Ownership diagnostics visible from a cluster control plane.
- Cluster
Peer Fetch Diagnostics - Point-in-time counters for an
InMemoryPeerFetchregistry. - Cluster
Peer Fetch Generation Mismatch - Requested owner generation did not match the current owner generation.
- Cluster
Peer Fetch Request - Cluster
Peer Fetch Response - Response returned by a peer-fetch implementation.
- Cluster
Pilot Readiness - Boolean readiness contract for a controlled internal production pilot.
- Cluster
Pilot Report - Dashboard-ready pilot snapshot.
- Cluster
Staging Counters - Additional staging counters that do not belong to local cache stats.
- Cluster
Staging Health - Staging-focused health summary derived from diagnostics and counters.
- Compat
Version - Semantic version used by upgrade guard checks.
- Conditional
Metrics - Conditional-write metrics.
- Consistency
Invalidate - Consistency
Readiness - Readiness summary for read-after-write overlap at chosen levels.
- Consistency
Token - Consistency
Unsatisfiable - Loud error returned when a requested consistency level cannot be satisfied.
- Consumer
Isolation - Tenant isolation state.
- Consumer
Isolation Config - Process-global and tenant admission limits.
- Control
Plane Snapshot - Control-plane snapshot used by backup/restore.
- Crdt
Merge Stats - Bounded-label CRDT merge counters.
- Crdt
Metadata GcGate - Confirmation gate for CRDT metadata GC.
- Diagnostics
- User-facing diagnostic snapshot for a local cache instance.
- Discard
Loser - Always discard loser-side entries.
- Durability
Error - Durability write-path error.
- Durability
Metrics Snapshot - Bounded aggregate metrics for the durability path.
- Durability
Snapshot Manifest - Durable snapshot manifest with a checksum-protected recovery watermark.
- Durability
Write Path - Durability write-path coordinator for one local node.
- Effective
Replication Map - Effective placement used while rebalance is in flight.
- Failure
Detector Metrics - Metrics emitted by the detector.
- Fence
Token - Monotonic fencing token returned by a lock acquisition.
- Foreground
Read Repair Outcome - Result of foreground read-repair.
- GCounter
- Grow-only counter CRDT.
- GeoBatch
- WAN replication batch. Compression is represented by deterministic accounting; adapters can map the payload to their concrete wire codec.
- GeoBatch
Apply Report - Apply report for one received batch.
- GeoWrite
- Active-active write stamped at the accepting region.
- GeoWrite
Ack - Result of accepting a local write.
- Hedge
Policy - Adaptive hedge delay source.
- Hedged
Read Plan - Hedged read execution plan.
- Higher
Version Wins - Default policy: keep the highest
(version, epoch)and let tombstones win ties throughReplicatedValueRecord::merge. - Hint
- Missed write captured for a replica that was temporarily unavailable.
- Hint
Budget - Bounded hint retention policy.
- Hint
Error - Errors returned by hint storage.
- Hint
Metrics - Hint store metrics with bounded labels represented by counters.
- HotCache
Directory - Tracks which nodes hold hot copies for authoritative invalidation fan-out.
- Hybrid
Logical Clock - Hybrid logical clock timestamp used for deterministic cross-region tie-breaks.
- Hydra
Cache - Local async cache runtime.
- Hydra
Cache Builder - Builder for a local
HydraCacheinstance. - Hydra
Cache Client Builder - Builder for a client near-cache connected to a HydraCache cluster.
- Hydra
Cache Member Builder - Builder for an in-process HydraCache cluster member.
- Idempotency
Key - Idempotency key attached to a cross-region replication write.
- InMemory
Cluster - In-process cluster model for tests, demos, and the first client/member API.
- InMemory
Cluster Discovery - In-memory discovery journal for tests, demos, and future adapter contracts.
- InMemory
Cluster Storage - In-memory deterministic storage implementation useful for tests.
- InMemory
Framed Invalidation Bus - In-memory framed invalidation bus for cross-process transport experiments.
- InMemory
Hint Store - In-memory bounded hint store used by tests and embedded adapters.
- InMemory
Invalidation Bus - In-process invalidation bus for tests, demos, and embedded multi-cache apps.
- InMemory
Object Store - In-memory object store for tests and examples.
- InMemory
Peer Fetch - In-memory peer-fetch implementation for tests, demos, and sandbox reports.
- InMemory
Replicated Value Store - Deterministic in-memory implementation used by the fast 0.42 tests and as the model for durable engine semantics.
- InMemory
Snapshot Sink - In-memory snapshot sink used by tests and examples.
- InMemory
Transport - In-memory transport endpoint used by W1/W5 deterministic tests.
- Invalidate
Batch - Single-partition invalidation batch.
- Invalidation
Event - Sequence-numbered invalidation retained for replay.
- Invalidation
Relay - Async relay between a local invalidation bus and an external transport.
- Invalidation
Relay Handle - Running invalidation relay with observable metrics.
- Invalidation
Ring - Bounded replayable invalidation ring for one partition.
- Invalidation
Ring Metrics - Ring metrics with bounded label sets represented as counters.
- Invalidation
Ring Snapshot - Durable-adapter snapshot of the recent invalidation window.
- Invalidation
Saga - Cross-partition best-effort invalidation fan-out unit.
- Invalidation
Target - One target of a best-effort invalidation saga.
- KeyMaterial
- Operator-supplied key material.
- KeyRange
- Inclusive key range that needs repair.
- Live
Read Your Writes Decision - Live read-path decision, including readiness posture.
- Live
Replication Peer - Peer-local replication stream state.
- Live
Replication Send - Outcome of one live replication send attempt.
- Live
Split Brain Resolution - Result of resolving a healed split-brain against live side snapshots.
- Load
Breaker Policy - Per-key loader circuit-breaker policy.
- Lock
Hold - Current state of one held fenced lock.
- Lock
Owner - Owner identity for a session-bound fenced lock.
- Logical
Duration - Logical simulator duration in milliseconds.
- Logical
Time - Logical simulator time in milliseconds.
- LwwRegister
- Last-writer-wins register CRDT using HLC as the deterministic tie-break.
- Manual
Cluster Clock - Manually advanced clock for tests and simulators.
- Merkle
Tree - Compact Merkle representation for one partition.
- Meta
Data Container - Per-partition near-cache watermark metadata.
- Monotonic
Read Violation - Error returned by strict monotonic read application.
- Monotonic
Write Violation - Error returned by strict monotonic write application.
- Namespace
Metric Labels - Bounded namespace labels for durability metrics.
- Namespace
Persistence Rule - One ordered persistence rule.
- Namespace
Persistence Settings - Concrete rule applied after namespace pattern matching.
- Namespace
Quota - Quota for one tenant-owned namespace.
- Node
Checkpoint Manifest - Per-node durable manifests collected for a cluster-wide checkpoint.
- Node
Topology - Authoritative topology attached to a cluster node.
- Options
- Per-entry cache behavior.
- OrSet
- Observed-remove set CRDT.
- OrSet
Tag - Unique add/remove tag used by OR-set entries.
- Outbound
Cluster Message - Message ready to be sent by a production or simulator driver.
- Partition
Digest - Digest exchanged by regions during anti-entropy.
- Partition
Id - Stable partition id used as a thin indirection over rendezvous ownership.
- Partition
Key - Session-visible partition/region dependency key.
- Partition
Move - One resumable partition movement.
- Partition
Replica Versions - Per-replica version table used by anti-entropy.
- Persistence
Config - Declarative persistence configuration mirroring Hazelcast-style per-map blocks.
- Persistence
Config Error - Persistence config validation error.
- Persistence
Maintenance - Durable maintenance settings resolved from persistence config.
- Persistence
Maintenance Config - Serde-friendly durable maintenance config.
- Persistence
Namespace Config - Per-namespace persistence config.
- Persistence
Policy - Deterministic namespace persistence policy.
- Persistence
Policy Error - Persistence policy construction/validation error.
- Persistence
Recovery Config - Recovery settings in serde-friendly seconds.
- Persistence
Region Placement - Placement regions for a namespace used by persistence-region validation.
- PhiAccrual
Config - Phi-accrual detector configuration.
- PhiAccrual
Detector - Adaptive heartbeat detector that outputs suspicion level, not ownership.
- PitrLog
- PITR log shipped after a full backup checkpoint.
- Pitr
Record - One point-in-time restore change record.
- PnCounter
- Positive-negative counter CRDT.
- Postcard
Codec - Default compact binary codec for v0.
- Promotion
Freeze Window - Measured write-freeze window for backup promotion.
- PutIf
Absent - Keep loser entries only when the winner side has no value.
- Quorum
Read Decision - Decision returned by a quorum read.
- Raft
Metadata Snapshot - Snapshot of the raft-style metadata journal.
- Raft
Style Metadata Control Plane - Dependency-free, raft-style cluster metadata control plane.
- Read
Options - Read options carrying the per-operation consistency override.
- Rebalance
Plan - Rebalance plan committed by the single coordinator.
- Rebalance
Task Ack - Acknowledgement for one rebalance task.
- Recovered
Namespace - Recovery result for one namespace.
- Recovery
Error - Recovery error.
- Recovery
Namespace - Namespace recovery input.
- Recovery
Policy - Full-cluster-restart recovery policy.
- Recovery
Report - Aggregate recovery report.
- Refresh
Options - Refresh behavior for loader-based cache reads.
- Region
Failover Error - Error returned by region failover helpers.
- Region
Failover Metrics - Bounded metric snapshot for region failover surfaces.
- Region
Id - Stable region identifier used by zone-aware placement.
- Region
Link - WAN-aware replication link state.
- Region
Link Error - Error returned by region-link helpers.
- Region
Observation - Conservative input for region-state detection.
- Region
Promotion - Region-home promotion committed through the control-plane topology epoch.
- Region
Promotion Report - Result of a region-home promotion.
- Region
Restore - DR restore input: control-plane snapshot plus operator-restored durable values.
- Region
Restore Error - Error returned by DR restore helpers.
- Region
Restore Outcome - Completed DR restore result.
- Region
Restore Report - Operator-visible DR restore report.
- Region
State Detector - Conservative detector: automatic checks can only move a region to
Suspect. - Rendezvous
Cluster Ownership - Deterministic rendezvous-style ownership resolver.
- Repair
Report - Report from one repair session run.
- Repair
Session - Repair session state for one partition.
- Repair
Token - Incremental repair watermark.
- Repairing
Task - Per-partition near-cache repair task.
- Replica
Observation - Health and latency observation for one replica.
- Replica
Scorer - EWMA/zone-aware replica scorer.
- Replicas
- Primary plus backup owners for one replicated key or partition.
- Replicated
Value Record - Durable replicated value record keyed externally by cache key.
- Replication
Config - Replication/quorum configuration for the 0.41 grid slice.
- Replication
Crypto Error - Error returned by replication encryption/decryption providers.
- Replication
Payload - Prepared replicated payload plus posture metadata.
- Rescale
With Checkpoint Plan - Reshard plan bound to a verified cluster-wide checkpoint.
- Reshard
Plan - Resumable online resharding plan.
- Reshard
Plan Error - Error returned when a move would break placement invariants.
- Residency
Audit Event - Append-only residency audit event retained until W6 installs a pluggable sink.
- Residency
Link Send Report - WAN send report after applying residency governance.
- Residency
Metrics Snapshot - Bounded residency metrics.
- Residency
Narrowing Report - Report for policy-narrowing remediation.
- Residency
Policy - A namespace/key residency policy committed through the authoritative control plane.
- Residency
Policy Enforcer - Runtime policy enforcer for placement, WAN movement, reads, and policy changes.
- Residency
Policy Error - Error returned while committing or validating residency policies.
- Residency
Policy Set - Authoritative residency policy set.
- Residency
Rejection - Loud residency rejection surfaced to callers and audit sinks.
- Residency
Value Location - One value location used when a narrowed policy is evaluated.
- Resolved
Persistence - Resolved namespace persistence decision.
- Scrub
Error - Scrubber error with key context.
- Scrub
Report - Scrubber run report.
- Scrubber
- Rate-limited replicated-record scrubber.
- Sealed
Artifact - Persistable sealed at-rest artifact.
- Session
Context Metrics - Aggregate session-context metrics.
- Session
Failover Recovery - Bounded failover recovery report for diagnostics/audit.
- Session
Guarantee Unmet - Error returned when a session guarantee cannot be met within budget.
- Session
Heartbeats - Logical heartbeat table for session-owned fenced locks.
- Session
Id - Stable client/application session id.
- Session
Monotonic Metrics - Session monotonicity metrics.
- Session
Read Budget - Escalation budget for a session read.
- Session
RywMetrics - Session RYW metrics.
- Session
Sequence - Monotonic per-session sequence assigned by the caller or session coordinator.
- Session
Token - Tamper-evident client-carried session token.
- Session
Ttl - Session token TTL in logical milliseconds.
- Session
Watermark - Bounded session watermark carried by the client token.
- Session
Write Stamp - Last accepted write stamp for one session and partition.
- Single
KeyConditional Store - Deterministic single-key conditional store backed by versioned records.
- Snapshot
Error - Snapshot sink error.
- Split
Brain Report - Split-brain merge report retained in diagnostics.
- Staleness
Bound - Explicit staleness budget for a session read.
- Static
AtRest KeyProvider - Static key provider useful for tests and operator-wired deployments.
- Stats
- Snapshot of lightweight cache counters.
- Storage
Op - Storage request ready to be performed by the driver.
- Storage
Result - Storage result returned by the driver.
- TagSet
- A reusable set of cache invalidation tags.
- Tenant
- Configured tenant.
- Tenant
Id - Bounded tenant identifier from the configured roster.
- Tenant
Metrics Snapshot - Bounded tenant metrics.
- Tenant
Roster - Configured tenant roster. Unknown tenants are refused before metrics labels.
- Tiered
Value Store - Two-tier replicated value store used by the 0.43 tiering gate.
- Tombstone
Budget - Tombstone retention budget.
- Tombstone
Tracker - Small deterministic tombstone budget tracker used by the 0.41 gate tests.
- Topology
Authority - Control-plane-owned topology catalog. Gossip observations never become authoritative until committed here.
- Topology
Fence - Minimal epoch fence for topology-authoritative decisions.
- Transport
Config - Configuration for an invalidation relay.
- Transport
Metric Descriptor - Static metric descriptor used by observability adapters.
- Transport
Metrics - Bounded-label invalidation relay counters.
- Transport
Metrics Snapshot - Snapshot of invalidation relay counters.
- Transport
Posture - Transport-security posture declared for a controlled cluster pilot.
- Typed
Cache - A typed, namespaced view over a
HydraCache. - Upgrade
Guard - Upgrade guard backed by the compatibility register.
- Upgrade
Guard Error - Upgrade guard error.
- Upgrade
Step - One rolling-upgrade step.
- Value
Store Error - Value-store admission error.
- Version
Stamp - Version stamp used by session watermarks.
- Version
Summary - Per-partition version summary for cross-region anti-entropy.
- Write
Barrier Token - Write
Options - Write options carrying the per-operation consistency override.
- Write
Watermark - Client-carried write watermark for read-your-writes reads.
- Zone
Aware Replica Set - Replica set with topology tags and underspread diagnostics.
- Zone
Aware Replication Strategy - Zone-aware placement strategy that preserves flat rendezvous behavior when all nodes belong to one zone.
- ZoneId
- Stable availability-zone identifier used by placement and locality reads.
- Zone
Placement Readiness - Readiness report for zone-aware placement.
Enums§
- Active
Active Acknowledgement - Explicit acknowledgement that active-active weakens cross-region consistency.
- Admission
Error - Admission error returned instead of unbounded queueing.
- Admission
Rejection - Structured admission rejection.
- Admission
Rejection Reason - Retryable rejection reason.
- Apply
Decision - Causal apply decision.
- Autoscaler
Intent - Autoscaler membership intent accepted through the guarded admission surface.
- Backup
Error - Backup and restore errors.
- Cache
Error - Errors returned by HydraCache.
- Cache
Event Kind - Kind of cache event emitted by a HydraCache runtime.
- Cache
Event Origin - Origin of a cache event.
- Cache
Event Recv Error - Error returned by
CacheEventSubscriber::recv. - Cache
Event Scope - Logical scope affected by a cache event.
- Cache
Event Value Mode - Value payload mode requested by event subscribers.
- Cache
Invalidation - Cache invalidation operation that can be propagated to another cache node.
- Cache
Invalidation Receive - Result of polling an invalidation receiver.
- CasResult
- Result of a single-key compare-and-set operation.
- Causal
Dependency Missing - Dependency that is missing before a causal write can become visible.
- Client
Ack - Immediate acknowledgement returned by the sans-IO node.
- Client
Op - Client operation accepted by the sans-IO node.
- Cluster
Admission Bridge Event - Event emitted by a cluster admission bridge.
- Cluster
Admission Ignore Reason - Reason why the admission bridge ignored a discovered candidate.
- Cluster
Admission Reject Reason - Reason why the admission bridge rejected a discovered candidate.
- Cluster
Checkpoint Error Kind - Stable checkpoint error kind used by recovery and tests.
- Cluster
Discovery Event - Cluster
Health Reason - Machine-readable reason used by
ClusterHealthState. - Cluster
Health State - Derived staging health state with machine-readable reasons.
- Cluster
Lifecycle Status - Lifecycle state for an embedded cluster component.
- Cluster
Membership Event - Cluster
Membership Recv Error - Error returned by
ClusterMembershipSubscriber::recv. - Cluster
Node Message - Transport-neutral cluster message emitted by a sans-IO node.
- Cluster
Replica Config Error - Replica/quorum pilot configuration error.
- Cluster
Role - Runtime role of a HydraCache instance.
- Conditional
Error - Errors returned by conditional writes and fenced locks.
- Consistency
Level - Per-operation consistency level for grid reads, writes, and invalidations.
- Consistency
Mode - Consistency
Outcome - Degrade
Reason - Durability
Error Kind - Stable durability error kind.
- Durable
Write Outcome - Result of routing one write through the durability path.
- Hint
Outcome - Outcome of admitting or replaying a hint.
- Hint
Replay Decision - Result of applying a hint against the target’s current record.
- Liveness
- Liveness signal that feeds gossip suspicion and repair/handoff gates.
- Monotonic
Read Decision - Monotonic read guard decision.
- Monotonic
Write Decision - Monotonic write guard decision.
- Move
Phase - Phase of an online partition move.
- Multitenancy
Error - Configuration errors for tenant isolation.
- Near
Cache Repair Action - Action selected by near-cache watermark repair.
- Persistence
Config Error Kind - Stable persistence config error kind.
- Persistence
Durability - Namespace persistence durability mode.
- Persistence
Durability Config - Serde-friendly persistence durability config.
- Persistence
Eviction - Persistence-time eviction intent for a namespace.
- Persistence
InMemory Format - In-memory representation preference mirrored from Hazelcast-style configs.
- Persistence
Matcher - A Hazelcast-style namespace pattern.
- Persistence
Region Selector Config - Serde-friendly region selector.
- Promotion
Phase - Promotion phase for deterministic backup failover.
- Quorum
Posture - Quorum posture reported by readiness and status surfaces.
- Raft
Metadata Command - Metadata command committed by
RaftStyleMetadataControlPlane. - Read
Consistency - Read consistency mode.
- Read
Escalation - Session read escalation decision.
- Rebalance
Task - Rebalance work materialized as committed data.
- Recovery
Error Kind - Stable recovery error kind.
- Recovery
Mode - Recovery strictness for persistent namespaces.
- Region
Selector - Region selection for persistent namespaces.
- Region
State - Operator-visible region health state used by region failover decisions.
- Rejoining
Region Decision - Decision for a region that rejoins after a promotion.
- Repair
Action - Repair action scheduled or recommended by self-healing.
- Repair
Kind - Repair execution mode.
- Repair
Mode - Auto-repair mode.
- Replay
Result - Replay result for a subscriber.
- Replica
Selection - Read replica selection mode.
- Replicated
Slot - Replicated value slot with tombstones participating in version ordering.
- Replicated
Value Security Posture - Replicated payload confidentiality posture.
- Replication
- Value-level replication eligibility.
- Replication
Config Error - Errors returned by
ReplicationConfig::validate. - Rescale
Checkpoint Phase - Phase of the stop-checkpoint-redistribute-resume rescale flow.
- Residency
Audit Action - Residency audit action.
- Residency
Decision - Residency decision used by diagnostics and policy dry-runs.
- Residency
Failover Decision - Failover decision that never chooses an out-of-policy home.
- Residency
Rejection Kind - Residency rejection kind.
- Residency
Remediation Action - Remediation action for a value location after policy narrowing.
- Routing
Mode - Client-side routing behavior for owner peer-fetch traffic.
- Scale
Action - Accepted scale action.
- Scale
Recommendation - Recommendation emitted for an external autoscaler or operator.
- Scrub
Error Kind - Scrubber error kind.
- Security
Error - Security lifecycle errors.
- Session
Failover Action - Session failover recovery action.
- Session
Lifecycle Decision - Session lifecycle validation decision.
- Session
Read Mode - Session read freshness mode.
- Session
Request - Request session mode.
- Session
Token Error - Token verification error.
- Staleness
Decision - Bounded-staleness read decision.
- Staleness
Escalation Reason - Why a bounded-staleness read had to escalate.
- Storage
OpKind - Storage request kind emitted by a sans-IO node.
- Tombstone
Admission - Result of admitting a tombstone under budget.
- Tombstone
Crdt Decision - Outcome of checking a CRDT update against an existing tombstone.
- Transport
Error - Error reported by an external invalidation transport.
- Write
Authority - Write-authority mode for a geo-distributed partition.
Constants§
- AT_
REST_ ARTIFACT_ FORMAT_ VERSION - Current at-rest sealed artifact format.
- BACKUP_
MANIFEST_ FORMAT_ VERSION - Current full-backup manifest format.
- CACHE_
INVALIDATION_ FRAME_ VERSION - Current binary encoding version for cross-process invalidation frames.
- CLUSTER_
CHECKPOINT_ MANIFEST_ FORMAT_ VERSION - Cluster checkpoint manifest format version registered in
docs/COMPAT.md. - CLUSTER_
PEER_ FETCH_ BASE_ URL_ METADATA_ KEY - Metadata key used by members to advertise their peer-fetch base URL.
- CONTROL_
PLANE_ SNAPSHOT_ FORMAT_ VERSION - Control-plane snapshot format version registered in
docs/COMPAT.md. - DURABILITY_
SNAPSHOT_ FORMAT_ VERSION - Snapshot manifest format version registered in
docs/COMPAT.md. - NODE_
TOPOLOGY_ REGION_ METADATA_ KEY - Metadata key used for a node’s authoritative region.
- NODE_
TOPOLOGY_ ZONE_ METADATA_ KEY - Metadata key used for a node’s authoritative zone.
- OTHER_
NAMESPACE_ METRIC_ LABEL - Aggregate label used when a namespace is not in the bounded metric roster.
- REPLICATED_
VALUE_ RECORD_ CHECKSUM_ FORMAT_ VERSION - Checksummed durable envelope version registered in
docs/COMPAT.md. - REPLICATED_
VALUE_ RECORD_ FORMAT_ VERSION - Durable value-store format version registered in
docs/COMPAT.md. - RESIDENCY_
POLICY_ FORMAT_ VERSION - Residency policy format registered in
docs/COMPAT.md.
Traits§
- AtRest
KeyProvider - Provider responsible for current and previous at-rest keys.
- Cache
Invalidation Bus - Transport abstraction for cross-cache invalidation.
- Cache
Invalidation Frame Sink - A bus that can apply an already encoded invalidation frame locally.
- Cache
Invalidation Receiver - Receiver side of a cache invalidation bus.
- Cluster
Clock - Deterministic clock seam used by the sans-IO cluster node.
- Cluster
Component - Uniform lifecycle surface for background cluster components.
- Cluster
Control Plane - Transport-neutral control-plane contract for cluster admission and metadata.
- Cluster
Discovery - Transport-neutral discovery contract for cluster candidates and liveness.
- Cluster
Ownership Resolver - Strategy for mapping cache keys to admitted cluster members.
- Cluster
Peer Fetch - Transport-neutral peer-fetch seam for future owner-side value loading.
- Cluster
Replication Strategy - Strategy for selecting primary and backup owners for a cache key.
- Cluster
Storage - Deterministic storage seam for production and simulation drivers.
- Conflict
Free Value - Conflict-free value that can converge under active-active replication.
- Durable
Flush - Adapter hook used by the durability write path to force a durable flush.
- Hint
Store - Bounded hint storage contract.
- Invalidation
Transport - Async transport for moving invalidation frames outside the process.
- Merge
Policy - Merge policy for loser-side entries after split-brain detection.
- Object
Store - Minimal object-store contract for backup backends.
- Redact
Replicated Value - Optional redaction hook before replicated bytes are sealed/sent.
- Replicated
Value Store - Durable replicated value-store seam.
- Replication
KeyProvider - Operator-supplied sealing boundary for replicated value bytes.
- Snapshot
Sink - Operator-supplied control-plane snapshot sink.
- Tenant
Resolver - Resolve a client identity to a bounded tenant id.
Functions§
- admit_
autoscaler_ intent - Validate an autoscaler intent against zone, quorum, and COMPAT invariants.
- anti_
entropy_ diff - Return keys where
localis newer or missing fromremote. - anti_
entropy_ repair - Repair a backup from a primary snapshot after anti-entropy detects lag.
- apply_
causal_ write - Apply a causal write or return the dependencies that must be repaired first.
- apply_
hint - Apply a hint if it is still newer than the target state and does not resurrect a tombstone.
- apply_
monotonic_ read - Apply a monotonic read by updating the watermark only if the candidate is safe.
- apply_
monotonic_ write - Apply a monotonic write, returning the new accepted stamp on success.
- causal_
apply - Decide whether a causal write can become visible on this replica.
- choose_
hlc_ tiebreak - Deterministically choose between equal
(version, epoch)writes using HLC. - cluster_
grid_ metric_ descriptors - Aggregate metric descriptors exported by the grid slice.
- converge_
replicated_ values - Reduce concurrent replicated records to one converged value through the merge policy.
- decode_
transport_ frame - Decode transport bytes using the relay’s fail-closed error taxonomy.
- diff_
effective_ maps - Deterministically diff two maps for one partition.
- evaluate_
capacity - Compute one capacity recommendation with dwell-time hysteresis.
- foreground_
read_ repair - Select the freshest record and repair divergent replicas inline.
- hedge_
winner - Choose the freshest read response by
(version, epoch). - live_
read_ your_ writes - Apply the read-your-writes quorum rule using the live replication config.
- liveness_
allows_ ownership_ change - Return whether a liveness signal is allowed to change ownership.
- liveness_
allows_ repair_ or_ handoff - Return whether handoff/repair may talk to this peer.
- merge_
split_ brain_ records - Merge loser-side records into winner-side records using a deterministic policy.
- partition_
for_ key - Return the deterministic partition for a key.
- plan_
hedged_ read - Build a hedged read plan without changing the required quorum count.
- prepare_
replicated_ payload - Prepare bytes for replication, honoring LocalOnly/redaction/encryption.
- promote_
region_ home - Promote partitions whose primary/home node belonged to
from_home. - quorum_
read_ your_ writes - Select a value for a RYOW quorum read.
- read_
manifest - Read and decode a manifest from object storage.
- rebuild_
expired_ sessionless - Convert an expired-token outcome into the safe downgrade path.
- recover_
cluster_ checkpoint - Recover persistent namespaces through a verified cluster checkpoint cut.
- recover_
namespaces - Recover persistent namespaces from an existing replicated value store.
- recover_
session_ after_ failover - Recover a client-carried session after region promotion.
- rejoining_
region_ authority - Apply the A1-style epoch fence to a rejoining region.
- replay_
hints - Replay all hints for a target against caller-provided current state.
- replicated_
slot_ version - Compose the version used for replicated values/tombstones.
- rescale_
with_ checkpoint - Create a rescale-with-checkpoint flow from a verified checkpoint and reshard plan.
- resolve_
live_ split_ brain - Resolve a healed split-brain from two live side snapshots.
- resolve_
monotonic_ read - Resolve whether a candidate read preserves monotonic reads.
- resolve_
monotonic_ write - Resolve whether an incoming write preserves session write order.
- resolve_
session_ read - Resolve a session read against the current watermark.
- resolve_
session_ read_ mode - Resolve a read under either strict causal or bounded-staleness mode.
- restore_
backup_ to_ point - Restore a full backup and replay PITR records up to
target_sequence. - restore_
topology_ from_ snapshot - Restore a topology authority from a snapshot.
- scale_
in_ removal_ allowed - Return whether a scale-in drain completed and the node can be removed.
- scale_
out_ counts_ toward_ quorum - Return whether every move has reached the committed owner.
- select_
backup_ promotion - Select the first backup as the deterministic promotion candidate.
- serve_
session_ read - Serve a session read and update the watermark, or fail loud if below the watermark.
- split_
brain_ winner - Return
(winner, loser)epochs according to the authority rule. - tombstone_
crdt_ decision - Enforce the A5 rule: a tombstone at an equal/higher
(version, epoch)wins. - topology_
from_ member_ metadata - Extract topology metadata from a member snapshot, when present.
- transport_
metric_ descriptors - Return the bounded-label metric descriptors emitted by the relay.
- validate_
move_ preserves_ zone_ quorum - Reject a move target that would co-locate write quorum in one zone.
- validate_
replica_ config - Validate the narrow 0.40 pilot replica/quorum shape.
- validate_
session_ lifecycle - Validate a token’s MAC/nonce/session and TTL.
- within_
staleness_ bound - Return whether the read can be served locally under the chosen mode.
- write_
full_ backup - Write a full backup to an object store and return its manifest.
- write_
pitr_ log - Write a PITR log object and return its key.
Type Aliases§
- Cache
Result - HydraCache result type.
- Sealed
Bytes - Bytes after the operator-supplied replication boundary has sealed/redacted them. Durable stores persist these bytes, never the original plaintext.
- Shared
Invalidation Ring - Shared invalidation-ring handle reserved for resume support.
- Shared
Replication KeyProvider - Shared pointer alias for operator-provided key providers.
- Value
Version - Monotonic version used by replicated value records.
Attribute Macros§
- cacheable
- Cache an ordinary async function with explicit local-cache metadata.