Design Dropbox (File Sync)
medium 60 minKeep a folder the same on every device of a person and everyone they share it with.
Where it shows up
The same pattern appears across everyday software.
A documented content hash
Dropbox's developer pages define its content hash: split the file into blocks of 4 MB, take SHA-256 of each, join them and take SHA-256 again.
Blocks inside larger buckets
Dropbox wrote that Magic Pocket stores blocks of up to 4 MB, groups them into 1 GB logical units, encodes them for repair and keeps them in several regions.
Identities instead of paths
Dropbox's article on its new sync engine says that files and folders have unique identifiers, and that a move is atomic whatever the size of the folder.
Sync without a server
Syncthing's documentation describes blocks of 128 KiB to 16 MiB with SHA-256, and a renamed file when two devices changed the same one.
Git
Git's own book calls it a content-addressable filesystem: objects are named by their content, and a version is a tree of names.
Backups with moving borders
The backup tool restic documents content-defined chunking with Rabin fingerprints, so an insertion near the start does not change every later chunk.