Engineering · Published May 2, 2026
File Storage: From Local Disk to Object Storage
Attachment features start simple, until clients upload multi-gigabyte videos and ask for per-file permissions.
Nearly every admin system has attachments. The first version stores files in a local directory and records a path in the database. That works fine for a single server, small files and few users.
When it has to change
With multiple servers, local directories are not shared, and a file uploaded in one request may be missing in the next.
As volume grows, backup and migration costs climb and disk expansion becomes painful.
Compliance requirements need fine-grained access control that a directory tree cannot express.
A migration path
Abstract a storage interface first, so business code depends on the interface rather than the filesystem.
Write new uploads to object storage while legacy files stay at their paths and move gradually.
Serve downloads through signed URLs with expiry and permission checks, so files cannot be scraped directly.
Storage does not need to be perfect on day one, but the interface abstraction should exist from the start. Otherwise migration costs an order of magnitude more.
← Previous post
How a Small Team Learns New Technology
Next post →
The Hidden Cost of a Multilingual Product
Want to apply these ideas to your project?
We are happy to go deeper into implementation details, or to discuss the specific questions you are facing.
Start a conversation →