Problem statement
Design the service that lets users bookmark posts into named collections and keeps those bookmarks synced across all of a user's devices, reconciling edits made while a device was offline.
Operating context. A user saves posts and organizes them into collections, then expects the change to appear on their other devices within seconds. Devices go offline and make edits — add, remove, or move a bookmark — that may conflict when they reconnect, so the system must converge to one consistent state. The workload is read-heavy (opening the "Saved" view), but each user's sync fan-out is small because it targets only that user's own devices. A save on a phone should surface on a tablet quickly, and a cold device should load the full set fast.
Out of scope. The post content storage itself (bookmarks only reference post IDs), sharing collections with other users, full-text search over saved posts, and recommending what to save. Assume other teams own those.
What to produce. A high-level design covering: the data model for bookmarks and collections, the per-device delta-sync protocol, conflict resolution for concurrent offline edits, storage and partitioning by user, and the change-notification path that nudges a user's other devices. Sketch the components and the sync flow; checkpoints will probe the delta protocol and conflict resolution.
Functional requirements
- Add or remove a bookmark referencing a post, optionally within a named collection.
- Sync a device to the latest state via incremental deltas since its last sync token.
- Reconcile concurrent add, remove, and move edits made on different, possibly offline, devices.
- Create, rename, and delete collections and move bookmarks between them.
- Notify a user's other online devices of changes so they refresh within seconds.
Non-functional requirements
- 200M users averaging about 500 bookmarks each; 300,000 bookmark writes/sec at peak.
- Delta-sync read p99 under 100 ms; a save propagates to another online device within 3 seconds.
- Per-user data is strongly consistent; cross-device convergence within 5 seconds of reconnect.
- 99.9% availability; no acknowledged bookmark lost under single-AZ failure.
- A device offline up to 30 days re-syncs incrementally without a full reload where possible.
- A user's full set of up to about 10,000 bookmarks loads in under 500 ms on a cold device.
Topics
- System Design HLD
- Sync Delta
- Data Conflict-Resolution
- Scaling Per-User
- Social Bookmarks