> For the complete documentation index, see [llms.txt](https://amartyushov.gitbook.io/tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amartyushov.gitbook.io/tech/system-design/interview-preparation/plan/dropbox.md).

# Dropbox

<figure><img src="/files/8v58K7bk73w429dcJU93" alt=""><figcaption></figcaption></figure>

## Client side

### Watcher

Watches directory for added files. Send info to indexer about added files.

### Indexer

Receives events about files added, deleted. Breaks down the file in chunks. Add info about file chunks to local metadata DB.&#x20;

### Chunker

Chunk the file by given location. 4Mb blocks.

Versioning

<figure><img src="/files/tgauzS1im8IHQ3LpCzE8" alt=""><figcaption></figcaption></figure>

## Server side

At first we upload blocks of file (step 4). Once it is confirmed we send a message to the queue.

This queue can be split by geo or buy other means.&#x20;

### Sync service

Saved metadata, makes sure that all info and file content is consistent.

Notification about file changes from Notification service can be delivered via Websocket or HTTP long polling.

<figure><img src="/files/WHTbOollx3X3rTMMSHA0" alt=""><figcaption></figcaption></figure>
