sync-strategies
Installation
SKILL.md
Sync Strategies
Instructions
Sync is the hardest part of offline-first. Pick the simplest strategy that meets the product's consistency needs. Do not default to CRDTs because they are fashionable.
1. Strategy Menu
| Strategy | Direction | Good for | Cost |
|---|---|---|---|
| Pull (poll) | Server -> client | Read-heavy, infrequent changes | Latency, wasted requests |
| Push (server-initiated) | Server -> client | Real-time notifications | Infrastructure (APNs/FCM/WS) |
| Delta sync | Server -> client | Large datasets with incremental updates | Requires server cursors |
| Outbox push | Client -> server | Writes while offline | Ordering and retry logic |
| Bidirectional | Both | Collaborative features | Conflict resolution |
| Event log / CRDT | Both, merge-friendly | Collaborative + offline + conflict-heavy | Engineering complexity, payload size |
Most apps need pull + outbox. A subset need delta. Real-time collab needs bidirectional. CRDTs are reserved for cases where conflicts are the norm.