Skip to content

State Management Capability

The State Management capability provides unified state persistence across all pipeline modes.

Contract

public interface StateManagementContract extends BaseProviderContract {
    void write(String key, Object state);
    Object read(String key);
    List<Object> query(Map<String, Object> filter);
    void delete(String key);
    void checkpoint(String executionId);
    void restore(String executionId, String checkpointId);
}

What State is Managed

State Type Description
Pipeline execution state Current status (RUNNING, COMPLETED, FAILED, etc.)
Streaming state Checkpoints, savepoints, watermarks, offsets
Business dates Logical processing dates
Metrics Historical metric values
Recovery metadata Last checkpoint, failed stage, retry count
Provider-specific state Provider-managed operational state

State Key

All state is keyed by the composite StateKey:

record StateKey(
    String tenancy,
    String namespace,
    String dataset,
    String pipeline,
    String businessDate,
    String runId
) { }

State Transitions

State transitions are validated by the Echo service. Invalid transitions are rejected.

See Execution Modes for the full state machine diagrams.

Example Providers

Provider Use Case
PostgreSQL Durable state with SQL queries
Redis Low-latency state for streaming
DynamoDB Serverless, auto-scaling state
Apache Zookeeper Distributed coordination state