Design a File Storage System
Practice a file-storage design with metadata, object upload, multipart transfers, durability, lifecycle management, access control, and recovery.
What you'll learn
Run the architecture drill
- How to separate file metadata, object bytes, and asynchronous processing.
- Why multipart upload, checksum verification, and lifecycle rules shape storage design.
- How durability, regional recovery, and access control become interview tradeoffs.
File storage separates a small, strongly managed metadata problem from a potentially enormous byte-storage problem. Users care about successful upload, correct access, durable retrieval, and predictable lifecycle behavior. The architecture must make those promises without routing every byte through application servers.
Start with the architecture drill, then follow the request path through scale, failure, and a defensible interview answer.
Make your assumptions and decision path easy to inspect.
ATOFF architecture reasoning canvas
Design a File Storage System: the architecture drill
Short answer
A file-storage system separates authoritative metadata from large object bytes so uploads and downloads scale without routing every byte through application servers.
10× evolution
Scale object storage independently while metadata and access policy remain authoritative.
01 Decision checkpoint
Design brief
Store owner, object state, checksum, policy, and lifecycle in a strongly managed metadata record before exposing an object as available.
02 Decision checkpoint
First request path
Issue constrained upload or download URLs so object storage handles multipart transfer and application servers retain control without carrying data-plane load.
03 Decision checkpoint
Failure drill
Complete an upload only after size, checksum, scan, and object existence checks; orphan cleanup handles uploads that never reach this state.
Say it in the interview
I would keep metadata transactional, let object storage move bytes directly, and use a verified finalize step before making files visible.
- 1
Client
request upload: Metadata API access + lifecycle · multipart bytes: Object storage parts + bytes
- 2
Metadata API access + lifecycle
create pending file: File metadata store · bounded authority: Scoped upload session
- 3
File metadata store
- 4
Scoped upload session
upload grant: Client
- 5
Object storage parts + bytes
complete upload: Checksum + finalizer
- 6
Checksum + finalizer
mark verified: File metadata store · object event: Preview, scan, index workers
- 7
Preview, scan, index workers
- Client flows to Metadata API access + lifecycle via request upload.
- Metadata API access + lifecycle flows to File metadata store via create pending file.
- Metadata API access + lifecycle flows to Scoped upload session via bounded authority.
- Scoped upload session flows to Client via upload grant.
- Client flows to Object storage parts + bytes via multipart bytes.
- Object storage parts + bytes flows to Checksum + finalizer via complete upload.
- Checksum + finalizer flows to File metadata store via mark verified.
- Checksum + finalizer flows to Preview, scan, index workers via object event.
Walk the design under pressure
Model the file record separately from its bytes
A file record needs owner, logical name, object key, size, content type, checksum, lifecycle state, retention policy, and access policy. The object store holds byte blocks or objects; the metadata store answers listing, permission, version, and lifecycle questions. Keeping them separate avoids putting huge payload semantics into ordinary transactional queries.
Define whether files are immutable, versioned, soft-deleted, or immediately erased. Those rules affect caching, legal retention, user recovery, and the possibility of reusing an object key.
Let clients transfer bytes directly with bounded authority
For large files, the metadata service can issue a short-lived upload authorization scoped to a destination, size, content type, and expiry. The client uploads parts directly to storage, then finalizes. This keeps application servers from becoming a bandwidth bottleneck while retaining control over what object may be written.
Multipart upload needs a resumable session, ordered or indexed parts, checksums, an expiry cleanup path, and a finalization rule that marks a file available only after the object is complete and verified.
Durability is a replication and recovery promise
Ask how many copies, failure domains, and regions are needed before calling an upload durable. The answer affects cost, write acknowledgment latency, and recovery time. A backup is not enough if its restore path has never been measured or if metadata and bytes cannot be reconciled after a partial failure.
Lifecycle rules can move infrequently accessed objects to cheaper storage, but retrieval latency, deletion semantics, and legal holds must remain visible to the product. Avoid treating archival as a transparent implementation detail when users may need data quickly.
Staff-level insight: design the control plane and data plane separately
At staff scope, distinguish control-plane availability from data-plane availability. Users may be unable to list files while a direct object download still works, or vice versa. Define security boundaries, encryption key ownership, audit trails, recovery drills, and how a regional event affects each plane.
In an interview, evolve from a single object store and metadata table to multipart upload, background processing, replication, lifecycle automation, and regional replication only when the workload and recovery objectives require them.
Keep this with you
Key takeaways
- File metadata and file bytes have different storage, consistency, and access-control needs.
- Direct multipart upload protects application capacity while preserving scoped authorization.
- Durability claims require tested replication, reconciliation, and recovery behavior.
Practice aloud
Interview questions to explore
- 1.How does a client resume an upload after its network fails?
- 2.When is a newly uploaded file safe to expose to another user?
- 3.How do metadata and object bytes reconcile after a partial failure?
Common follow-ups
Frequently asked questions
Why not store file bytes directly in a relational database?
Small binary data can fit some use cases, but large or high-volume files place very different bandwidth, lifecycle, replication, and retrieval demands on a system than transactional metadata.
What is multipart upload?
It breaks a large object into independently transferable parts so a client can retry or resume portions, then finalize the object after all parts are present and verified.
Already an Elite member? Open the complete walkthrough.
Need the broader preparation context? Go back to Interview Preparation for behavioral readiness, question practice, and the larger AceTheOffer preparation framework.