Current State & Design Overview
1. Overview
The Sync Engine Service powers bidirectional incremental sync between a central server and offline mobile devices.
This system is designed to support:
- Real-time responsiveness using local SQLite DB on mobile
- Seamless synchronization when the network is available
- Incremental, log-based syncs to optimize bandwidth and storage
- A unified sync model across all modules
2. Key Features
- Offline-First Architecture: Full functionality without network connectivity
- Incremental Sync: Only data that has changed is synchronized between the mobile device and the server, minimizing bandwidth usage and synchronization time.
- Conflict Resolution: The system provides mechanisms for manual conflict handling, allowing users to resolve discrepancies between local and server data.
- Audit Trail: A complete history of all data changes is maintained, providing a detailed record of modifications for debugging, auditing, and potential rollback operations.
3. Why Offline-First?
The offline-first architecture is a cornerstone of the Sync Engine Service, particularly crucial where network connectivity is often inconsistent or unreliable. Key reasons for choosing this approach include:
- High Availability: Users can continue to work and access data regardless of network availability. This ensures uninterrupted productivity, especially in areas with poor or intermittent connectivity.
- Performance: Interactions with the application are near-instant since they interact with a local database. This eliminates the latency associated with network requests, providing a smooth and responsive user experience.
- Resilience: The offline-first approach reduces the risk of data loss due to intermittent connectivity. Changes are stored locally and synchronized when a connection becomes available, ensuring data integrity.
4. High-Level Sync Architecture & Data Flow
The data flow within the Sync Engine Service is divided into two primary directions: mobile to server and server to mobile.