Skip to main content

CheckpointingMode

Enum CheckpointingMode 

Source
pub enum CheckpointingMode {
    Eager,
    Batched,
    Optimistic,
}
Expand description

Checkpointing mode that controls the trade-off between durability and performance.

The checkpointing mode determines when and how often the SDK persists operation state to the durable execution service. Different modes offer different trade-offs:

§Modes

§Eager Mode

  • Checkpoints after every operation completes
  • Maximum durability: minimal work is lost on failure
  • More API calls: higher latency and cost
  • Best for: Critical workflows where every operation must be durable

§Batched Mode (Default)

  • Groups multiple operations into batches before checkpointing
  • Balanced durability: some operations may be replayed on failure
  • Fewer API calls: better performance and lower cost
  • Best for: Most workflows with reasonable durability requirements

§Optimistic Mode

  • Executes multiple operations before checkpointing
  • Minimal durability: more work may be replayed on failure
  • Best performance: fewest API calls
  • Best for: Workflows where replay is cheap and performance is critical

§Example

use durable_execution_sdk::CheckpointingMode;

// Use eager mode for maximum durability
let eager = CheckpointingMode::Eager;

// Use batched mode for balanced performance (default)
let batched = CheckpointingMode::default();

// Use optimistic mode for best performance
let optimistic = CheckpointingMode::Optimistic;

§Requirements

  • 24.1: THE Performance_Configuration SHALL support eager checkpointing mode
  • 24.2: THE Performance_Configuration SHALL support batched checkpointing mode
  • 24.3: THE Performance_Configuration SHALL support optimistic execution mode
  • 24.4: THE Performance_Configuration SHALL document the default behavior and trade-offs

Variants§

§

Eager

Checkpoint after every operation for maximum durability.

This mode provides the strongest durability guarantees but has the highest overhead due to frequent API calls.

§Characteristics
  • Every operation is immediately checkpointed
  • Minimal work lost on failure (at most one operation)
  • Higher latency due to synchronous checkpointing
  • More API calls and higher cost
§Use Cases
  • Financial transactions
  • Critical business workflows
  • Operations with expensive side effects
§Requirements
  • 24.1: THE Performance_Configuration SHALL support eager checkpointing mode
§

Batched

Batch multiple operations before checkpointing for balanced performance.

This is the default mode that provides a good balance between durability and performance. Operations are grouped into batches based on size, count, or time limits before being checkpointed together.

§Characteristics
  • Operations are batched before checkpointing
  • Some operations may be replayed on failure
  • Better performance than eager mode
  • Configurable batch size and timing
§Use Cases
  • Most general-purpose workflows
  • Workflows with moderate durability requirements
  • Cost-sensitive applications
§Requirements
  • 24.2: THE Performance_Configuration SHALL support batched checkpointing mode
§

Optimistic

Execute multiple operations before checkpointing for best performance.

This mode prioritizes performance over durability by executing multiple operations before creating a checkpoint. On failure, more work may need to be replayed.

§Characteristics
  • Multiple operations execute before checkpointing
  • More work may be replayed on failure
  • Best performance and lowest cost
  • Suitable for idempotent operations
§Use Cases
  • High-throughput batch processing
  • Workflows with cheap, idempotent operations
  • Performance-critical applications
§Requirements
  • 24.3: THE Performance_Configuration SHALL support optimistic execution mode

Implementations§

Source§

impl CheckpointingMode

Source

pub fn is_eager(&self) -> bool

Returns true if this mode checkpoints after every operation.

Source

pub fn is_batched(&self) -> bool

Returns true if this mode batches operations before checkpointing.

Source

pub fn is_optimistic(&self) -> bool

Returns true if this mode executes multiple operations before checkpointing.

Source

pub fn description(&self) -> &'static str

Returns a human-readable description of this mode.

Trait Implementations§

Source§

impl Clone for CheckpointingMode

Source§

fn clone(&self) -> CheckpointingMode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CheckpointingMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CheckpointingMode

Source§

fn default() -> Self

Returns the default checkpointing mode (Batched).

Batched mode is the default because it provides a good balance between durability and performance for most use cases.

Source§

impl<'de> Deserialize<'de> for CheckpointingMode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CheckpointingMode

Source§

fn eq(&self, other: &CheckpointingMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CheckpointingMode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for CheckpointingMode

Source§

impl Eq for CheckpointingMode

Source§

impl StructuralPartialEq for CheckpointingMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<B> IntoFunctionResponse<B, Body> for B
where B: Serialize,

Source§

fn into_response(self) -> FunctionResponse<B, Body>

Convert the type into a FunctionResponse.
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DurableValue for T