00
Blog
OFFLINE-FIRST
Design principles for offline-first architecture. Local database selection, sync strategies, and conflict resolution from real-world projects.
Last updated: May 2026
01
Context
Users aren't always online. On trains, planes, or roaming abroad — apps that don't work offline lose value in these moments. For learning and health apps especially, offline support is a differentiator.
02
Local DB
Recommended local databases by platform:
- Flutter: Drift (type-safe SQL) or Hive (fast key-value)
- React Native: WatermelonDB for large datasets, AsyncStorage for small
- iOS: Core Data for Apple ecosystem, GRDB for SQL
- Android: Room (Jetpack) or SQLDelight (KMP compatible)
03
Sync
Data synchronization approaches:
- last-write-wins: simplest but risks unintended data loss
- CRDT: automatic conflict resolution based on distributed systems theory
- Custom logic: timestamps + version vectors for manual resolution
- Queue-based: buffer all changes locally, apply sequentially when online
04
UX
UI patterns for communicating offline state:
- Background sync indicators: minimal distraction
- Optimistic UI: reflect locally immediately, rollback on failure
- Pending badges: explicitly show 'unsynced' state
- Offline-aware copy: 'will sync automatically' instead of 'please reconnect'
05
Contact
Planning offline support?
I've built multiple offline-first apps including Deckbase and EverJournal. Let's discuss your architecture.