Durable Edge-Outbox Synchronization: Managing Relational Divergence in Intermittent Mobile Enterprise Workloads
Mobile enterprise applications require multi-table transactional durability and a reviewable audit trail under intermittent or absent connectivity, a combination that neither last-write-wins replication nor Conflict-Free Replicated Data Types (CRDTs) delivers at acceptable cost on resource-constrained devices. This paper describes and formalizes the synchronization architecture of CLIVORA, a production Flutter application (240 Dart source files, 90,868 lines) whose edge persistence layer is a Drift/SQLite database at schema version 18. The architecture comprises three core mechanisms. First, a durable transactional outbox (sync_outbox_entries) assigns each mutation a UUIDv4 idempotency key (operation_id) scoped to an owning user (owner_user_id), advancing it through an explicit six-state automaton (pending, processing, retrying, conflicted, permanently_failed, completed) with exponential backoff capped at eight attempts. Second, cloud reconciliation runs over a per-user WebSocket channel against PostgreSQL under row-level security, with a 500 ms sliding debounce that collapses change event bursts into a single reconciliation pass. Third, divergence is never resolved silently: when local and cloud states disagree, the system stages the divergence in two tables (sync_conflict_entries on-device, crm_sync_conflicts in PostgreSQL) and exposes two deterministic resolution operators, take-cloud and keep-local. Crucially, keep-local re-enqueues local state as a fresh outbox operation rather than mutating cloud state directly, preserving a single path of transactional authorization. We pair this architectural formalization with a seeded microbenchmark of a reference model of the outbox mechanics rather than of the shipped Flutter client, measuring serialization, transactional SQLite WAL ingestion, and network partition recovery. Across ten trials of 1,000 enterprise operations, ingestion through durable commit averaged 25.135 ms (SD 2.846 ms, p99 31.327 ms), and total storage contracted to 9.1% of peak following post-sync tombstone sweeps.
Authors
- Muhammad Usman Khan (ORCID: https://orcid.org/0009-0009-4038-5762)
Institutions
- Computercraft (United States) (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-19
- DOI
- https://doi.org/10.5281/zenodo.22843764
- Primary Topic
- Distributed systems and fault tolerance
- Type
- preprint