entidb_sync_engine

Crates.ioentidb_sync_engine
lib.rsentidb_sync_engine
version2.0.0-alpha.3
created_at2025-12-25 15:06:18.595998+00
updated_at2026-01-03 03:41:49.725868+00
descriptionSync state machine and engine for EntiDB
homepage
repositoryhttps://github.com/Tembocs/entidb
max_upload_size
id2004640
size93,475
Tembo (Tembocs)

documentation

README

entidb_sync_engine

Sync state machine and engine for EntiDB.

Overview

This crate implements the synchronization state machine for EntiDB's offline-first architecture. It manages the pull-then-push protocol and handles conflict detection.

Features

  • State machine: Robust sync lifecycle (idle → connecting → pulling → pushing → synced)
  • Pull-then-push: Always pull remote changes before pushing local changes
  • Cursor tracking: Maintains server and local cursors for incremental sync
  • Conflict detection: Identifies concurrent modifications for resolution

Sync Flow

┌─────────┐     ┌───────────┐     ┌─────────┐     ┌────────┐
│  Idle   │────▶│ Connecting│────▶│ Pulling │────▶│ Pushing│
└─────────┘     └───────────┘     └─────────┘     └────────┘
     ▲                                                  │
     └──────────────────────────────────────────────────┘
                           (synced)

Usage

use entidb_sync_engine::SyncEngine;

let engine = SyncEngine::new(database, config);
engine.sync().await?;

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Commit count: 0

cargo fmt