Skip to main content

Module sync

Module sync 

Source
Expand description

§Storage Synchronization

Coordinates data synchronization between Turso (durable) and redb (cache) storage layers.

The synchronizer ensures:

  • Two-phase commit for consistency
  • Conflict resolution with Turso as source of truth
  • Periodic synchronization of cache from durable storage
  • Resilience to partial failures

§Example

use do_memory_core::sync::StorageSynchronizer;

let sync = StorageSynchronizer::new(turso_storage, redb_storage);
sync.start_periodic_sync(Duration::from_secs(300)).await;

Structs§

StorageSynchronizer
Storage synchronizer for coordinating Turso and redb
SyncConfig
Configuration for storage synchronization
SyncState
Synchronization state tracking
SyncStats
Synchronization statistics
TwoPhaseCommit
Two-phase commit strategy for episode storage

Enums§

ConflictResolution
Conflict resolution strategy

Functions§

resolve_episode_conflict
Resolve conflict between two episodes
resolve_heuristic_conflict
Resolve conflict between two heuristics
resolve_pattern_conflict
Resolve conflict between two patterns