← Questions

Design client-server file sync with a Merkle tree

0
CursorSystem designLast asked Aug 2026

A server publishes immutable versions of a directory tree, and clients keep local mirrors in sync with a chosen version. Every file has a content hash and every directory a hash of its children's hashes.

Design the sync: what snapshot metadata the server keeps, how a client compares root hashes and walks down only into subtrees that differ, how the resulting plan covers new, changed and deleted files, how only the needed content is transferred, how an interrupted sync resumes safely against the same version, and how the client verifies the rebuilt root hash before reporting success. Also cover caching and what you would monitor. Two-way editing and conflict resolution are out of scope.

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing