Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

Workflow Checkpoint Storage Primitives (Task 6)

This module provides durable workflow state persistence as a storage primitive, NOT an orchestration framework. External frameworks (Temporal, Airflow, custom) can use this as a clean storage API for:

  • Checkpoint storage: CHECKPOINT(run_id, node_id, state_blob)
  • Checkpoint retrieval: RESUME(run_id)
  • Run metadata

§Architecture Decision

SochDB is the source of truth for state (runs/events/checkpoints). Scheduling and execution are handled by external orchestrators. This separation of concerns:

  • Preserves clean API boundaries
  • Avoids building a competing orchestration framework
  • Enables easy integration with existing tools

§Complexity

  • Checkpoint write: O(S) where S is state size
  • Checkpoint read: O(S)
  • List checkpoints: O(log N + k) with index
  • Recovery: O(S + m) where m is events since snapshot

§Schema

_checkpoints/{run_id}/meta              -> RunMetadata
_checkpoints/{run_id}/nodes/{node_id}   -> CheckpointData
_checkpoints/{run_id}/events/{seq}      -> EventData

Structs§

Checkpoint
A checkpoint snapshot
CheckpointMeta
Metadata about a checkpoint (without the state blob)
DefaultCheckpointStore
Default checkpoint store implementation using ConnectionTrait
RunMetadata
Metadata about a workflow run
WorkflowEvent
An event in the workflow event log

Enums§

RunStatus
Status of a workflow run

Traits§

CheckpointStore
Trait defining the checkpoint storage interface

Type Aliases§

NodeId
Unique identifier for a node within a run
RunId
Unique identifier for a workflow run
SeqNo
Sequence number for events