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.
Must do 5
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.