Object Storage in System Design
Profile photos, invoices, product videos, backups and log archives share one trait: they are files that are written once, read many times and rarely edited. Putting them in a relational database bloats it, and putting them on a server's local disk ties them to one machine. Object storage is the purpose-built home for this kind of data.
Services such as Amazon S3, Google Cloud Storage and Azure Blob Storage store trillions of objects and scale without any capacity planning. This tutorial explains how object storage works, how it differs from block and file storage, and how presigned URLs let clients upload files safely. It builds on Database Sharding and Data Partitioning, which handle structured data.
1. What Is Object Storage?
Object storage is a storage architecture that manages data as objects. Each object contains the data itself, a unique key and metadata, and objects live in flat containers called buckets. Applications read and write whole objects through an HTTP API rather than through a mounted file system.
Because there is no folder hierarchy to keep consistent and no disk to attach, an object store can spread data across thousands of machines and data centres. Durability comes from keeping several copies or erasure-coded fragments of every object; Amazon S3, for example, is designed for 99.999999999% (eleven nines) durability.
2. Object Storage Architecture
The application server only signs requests. The heavy traffic of uploading and downloading files goes straight between the client, the bucket and the CDN, so the application stays small and does not need extra bandwidth for files.
3. How Object Storage Works
Take a user uploading a profile photo in a shopping app:
- Request: the app asks the backend for permission to upload an image.
- Sign: the backend creates a unique key such as
uploads/9f3c…and returns a presigned URL: a normal HTTPS URL with an expiry time and a signature made from the backend's credentials. - Upload: the app sends
PUTto that URL with the image bytes. The object store checks the signature and expiry, stores the object and replicates it. - Record: the backend saves the key in its database next to the user record. The database stores a short string, not megabytes of image data.
- Serve: other users load the photo through a CDN that fetches the object once and caches it near them.
Objects are immutable: changing a photo means writing a new object or version, never editing bytes in place.
4. Block, File and Object Storage
Cloud platforms offer three families of storage. Seeing them side by side makes it clear when object storage is the right choice.
Block storage
Provides a raw disk split into fixed-size blocks, such as Amazon EBS or a SAN volume. The operating system formats it with a file system. It has the lowest latency and suits databases and boot disks, but a volume is normally attached to one machine.
File storage
Provides a shared folder tree over a network protocol, such as NFS, SMB or Amazon EFS. Many servers can read and write the same paths, which suits shared content and legacy applications, but very large file systems are harder to scale.
Object storage
Provides buckets of objects behind an HTTP API, such as Amazon S3, Google Cloud Storage, Azure Blob Storage or the self-hosted MinIO. It scales almost without limit and is the cheapest per gigabyte, but objects are replaced as a whole and each request has higher latency than a local disk.
Key concepts
- Bucket: a named container with its own access rules, region and settings.
- Key: the object's unique name inside the bucket. Prefixes such as
reports/2026/act like folders for listing. - Metadata: system data such as size and content type, plus your own tags.
- Versioning: keeps older versions of a key so that overwrites and deletes can be undone.
- Storage classes and lifecycle rules: move rarely used objects to cheaper tiers automatically, or delete them after a set time.
- Consistency: Amazon S3 offers strong read-after-write consistency for all requests, so a read after a successful write returns the new data.
5. Advantages and Disadvantages
Advantages
- Practically unlimited scale with no capacity planning.
- Very high durability through replication or erasure coding.
- Low cost per gigabyte, with cheaper tiers for cold data.
- Simple HTTP API usable from any language, and direct client uploads through presigned URLs.
- Rich metadata, versioning and lifecycle automation.
Disadvantages
- Higher latency per request than block storage, so it is unsuitable for database files.
- No partial updates: changing one byte means rewriting the object.
- No real folders, so renaming a "folder" means copying every object under the prefix.
- Request and data-transfer charges can grow with very chatty access patterns.
6. Block vs File vs Object Storage
| Aspect | Block storage | File storage | Object storage |
|---|---|---|---|
| Unit of data | Fixed-size blocks | Files in folders | Objects with key and metadata |
| Access method | Mounted disk | NFS or SMB share | HTTP API (PUT, GET, DELETE) |
| Shared by many servers | Rarely | Yes | Yes, by any client with access |
| Latency | Lowest | Low | Higher per request |
| Scale | Per volume | Up to large file systems | Virtually unlimited |
| Typical use | Databases, boot disks | Shared content, home folders | Media, backups, logs, data lakes |
| Examples | Amazon EBS, SAN | Amazon EFS, NFS server | Amazon S3, MinIO, Azure Blob |
7. Real-World Use Cases
- User uploads: profile pictures, documents and attachments stored by key, with only the key kept in the database.
- Static websites and media: images, scripts and videos served through a CDN; see What Is a CDN.
- Backups and archives: database dumps moved to cold storage tiers by lifecycle rules.
- Logs and analytics: data lakes where query engines read files directly from buckets.
- Microservices: services pass a key or a presigned URL in an event instead of sending large files through a message broker.
8. Best Practices
- Keep buckets private: block public access and share files only through presigned URLs or a CDN with origin access control.
- Use short expiry times on presigned URLs, and generate keys on the server instead of trusting client file names.
- Never store access keys in code: use IAM roles or workload identity, as the default credentials chain does.
- Validate uploads: check content type and size, and scan files before other users can download them.
- Enable encryption and versioning, and add lifecycle rules for temporary and old data.
- Upload large files in parts: multipart upload allows parallel parts and retrying only the failed part.
9. Summary
- Object storage keeps data as objects (key, data, metadata) in flat buckets behind an HTTP API.
- It scales almost without limit and is highly durable and cheap per gigabyte.
- Block storage suits databases, file storage suits shared folders, and object storage suits files written once and read often.
- Presigned URLs let clients upload and download directly while the bucket stays private.
- Store keys, not file contents, in your database, and serve popular objects through a CDN.
Next, see how those objects reach users quickly in What Is a CDN.
Object Storage: Top Interview Questions
These are the object storage questions most often asked in system design interviews, with short answers you can explain in your own words.
Q1. What is the difference between block, file and object storage?
Block storage exposes a raw disk of fixed-size blocks to one machine; file storage exposes a shared folder tree over NFS or SMB; object storage stores whole objects with a key and metadata in flat buckets, accessed through an HTTP API. They trade latency, sharing and scale differently.
Q2. What is a presigned URL, and why use it?
A URL that carries a signature and an expiry time, created with the server's credentials. It lets a client upload or download one specific object directly from the bucket for a short time, so the bucket stays private and large files never pass through the application servers.
Q3. Why should you not store images in a relational database?
Large binary data bloats the database, slows backups and replication, and uses expensive database storage and memory. Storing the file in object storage and only its key in the database keeps the database small and lets a CDN serve the files.
Q4. Object storage has no folders. How do prefixes work?
Keys are flat strings. A key such as reports/2026/11.pdf merely contains slashes, and listing with a prefix and delimiter makes it look like a folder. Renaming a "folder" therefore means copying and deleting every object that shares the prefix.
Q5. How would you design file uploads for a large-scale app?
The client asks the backend for a presigned URL, uploads straight to object storage (using multipart upload for large files), and the backend stores the key after an upload-complete event. A scanner checks the file, lifecycle rules clean up abandoned uploads, and a CDN serves downloads.