Skip to content

Stage 7 of 7 · Defend it

Dropbox-Style File Sync Service: Delete now; reclaim bytes only when safe

Deleting one path may not make its blocks unreachable: another version or another file may reference the same content. A restore can also race with a cleanup job that previously saw no references.

System so far· 5 parts
12345CLIENTDesktop andmobile clientsEDGEFile APISERVICEMetadata serviceDATABASEMetadatadatabaseSERVICEChange notifier

Select a component to see what it is responsible for and which state it owns.

  1. 1Desktop and mobile clients → File API: Upload, download and sync requests
  2. 2File API → Metadata service: Conditional metadata operations
  3. 3Metadata service → Metadata database: Commit version and append journal row
  4. 4Metadata database → Change notifier: Journal advanced
  5. 5Change notifier → Desktop and mobile clients: Wake, then page from cursor
  • Request / response
  • Asynchronous
  • Server push

What you need to know

  1. Make delete a metadata operation first: append a tombstone, remove the version from the active namespace, and preserve it for the product's retention window. A collector finds blocks unreachable from all retained manifests, but a stale mark is not permission to delete immediately. Recheck reachability and wait beyond the maximum metadata replication and in-flight upload delay.

  2. At large scale, immutable blocks simplify reads and retries but move complexity into reclamation. Garbage collection identifies unreferenced content; compaction is the physical work that makes space reusable. Dropbox's public Magic Pocket posts describe this trade-off in its own storage system; the exercise uses it as an operational lesson, not as a claim that this design matches their implementation.

Your turn

The collector marked block H unreferenced yesterday. What can it safely do today?

Depends means the statement is true under some conditions in the scenario and false under others. Use it when you can name the condition.

  1. 01Delete H immediately because yesterday's reference scan found zero owners.

    Verdict for statement 1
  2. 02Keep H while any retained version manifest still references it, even if the current path was deleted.

    Verdict for statement 2
  3. 03Recheck reachability at deletion time and make the delete operation safe to retry.

    Verdict for statement 3

0 of 3 answered.