Durability Profile Contract
View SourceBedrock.Durability provides a machine-checkable contract for evaluating and
enforcing durability profile requirements.
For consolidated operator guidance across profile checks, S3 persistence, WAL
boundaries, and migration sequencing, see
guides/durability-foundation.md.
API
Checks
The profile currently evaluates:
desired_replication_factor >= 3desired_logs >= 3- coordinator persistence enabled (
coordinator.persistent == true, or implied by a coordinator path when unset) - persistent
coordinator.path - persistent log path
- persistent materializer path
Result Shape
profile/1 returns a %Bedrock.Durability.Profile{}:
status-:ok | :failedchecks- map of check name to%{status, expected, actual, reason}reasons- list of failure reason atomsevaluated_at_ms- evaluation timestamp
Enforcement
require/2 supports two modes:
:strict- returns{:error, {:durability_profile_failed, reasons}}when profile fails.:relaxed- returns:okeven when profile fails.
This allows downstream adapters to fail fast in strict deployments while still supporting gradual rollout in relaxed mode.
Runtime Startup Enforcement
The internal cluster supervisor enforces this profile at startup:
:strictmode (default): raises and fails startup when checks fail.:relaxedmode: logs warning and continues.- unsupported values resolve to
:strict.
Mode configuration is additive:
top-level
:durability_mode(:strict | :relaxed)or
durability: [mode: :strict | :relaxed]
Explicit development override:
config :bedrock, MyCluster,
durability_mode: :relaxedDesired sizing parameters can be provided via:
- coordinator cluster config (
parameters.desired_replication_factor,parameters.desired_logs) - or node config fallback (
durability: [...]).
Telemetry Events
Profile evaluations emit one of:
[:bedrock, :durability, :profile, :ok][:bedrock, :durability, :profile, :failed]
Measurements:
failed_checks- number of failed checks
Metadata:
status-:ok | :failedreasons- list of failure reason atomstarget_type- input type (:cluster_module | :node_config | :profile_input)target_module- cluster module when applicable