Skip to main content

File store

File contents live in a folder, STORAGE_DIR. Each file is stored once, named by its SHA-256:

storage/objects/1d/1d70498e6816…
storage/objects/ff/ffdf9ecd17bb…

Upload the same file twice, make a version, branch or take over: it's still one file. A file that nothing refers to any more is deleted when it's replaced.

Uploads are streamed straight to disk, so large files don't pass through memory.

Only the PDM writes here. Don't add, rename or remove files by hand. Back it up together with the database.

S3-compatible storage is planned. Only the store knows how files are laid out, so it can be swapped without touching the rest.