Stage 4 of 7 · Decide
Dropbox-Style File Sync Service: Catch up from a durable cursor
A laptop has been asleep for three weeks. During that time its owner changed 80 files and a shared folder received 12,000 changes. The phone is online and expects updates within a few seconds.
System so far· 1 parts
Select a component to see what it is responsible for and which state it owns.
What you need to know
Give each namespace an ordered journal and each device a durable cursor. A client requests changes after its cursor in bounded pages, applies them, then saves the cursor. If it crashes while applying a page, it can safely repeat it using stable change IDs and idempotent local operations.
Check
What should a reconnecting device do after missing notifications?A cursor expires only if the server has compacted the journal past it. Make that response explicit: tell the client to rebuild from a snapshot at sequence S, then continue after S. Silently returning only recent changes would leave the device permanently inconsistent.