Appearance
Offline Synchronisation Strategy
1. Resilience Philosophy
In a festival field environment, mobile infrastructure experiences extreme congestion. Network calls are treated as unreliable side-effects; local operations are instantaneous and unblocking.
2. Storage Dual-Layer Strategy
| Layer | Technology | Primary Function |
|---|---|---|
| Edge | Cloudflare D1 | Authoritative public schedules, global user route backup. |
| Device | Dexie.js (IndexedDB) | Active runtime storage, personal schedule overrides, route calculations. |
3. Sync Engine Workflow
[User Action] │ ▼ [Write to Dexie.js] ──► (Instant UI Render) │ ▼ [Check Connectivity (navigator.onLine)] ├── NO ──► Queue in IndexedDB (sync_status = 'pending') └── YES ──► POST to Cloudflare Worker API │ ├── SUCCESS ──► Mark local record as 'synced' └── FAILURE ──► Retain 'pending' state; retry on next online event
4. Conflict Resolution
- Client Priority: For personal schedule changes (e.g., selected bands), local client timestamps overwrite edge records.
- Read-Only Master Data: Festival schedules, stage names, and band times are read-only from the Cloudflare D1 source and cannot be modified by client instances.