Ever wondered what really happens when you upload a file to Amazon S3 or a similar object storage system? π€
Letβs break it down with clear concepts and step-by-step architecture.
π·οΈ Key Concepts to Know
πΉ Bucket β A globally unique logical container for objects. You can think of it like a top-level folder.
πΉ Object β A piece of data stored inside a bucket. It consists of:
- π Object Data: The actual content (file, image, video, etc.)
- π§Ύ Metadata: Key-value pairs describing the object (e.g., name, ID, content type)
π Note:
- Buckets only store metadata
- Objects contain both metadata and data
- Object data is immutable, while metadata can be mutated
πExample path: /bucket-to-share/script.txt
Here, bucket-to-share
holds the metadata, and script.txt
is the object containing your data.
π The Upload Flow (Step-by-Step)
Hereβs what happens when you upload a file to S3:
1οΈβ£ Client creates a bucket
β Sends an HTTP PUT
request for bucket-to-share
.
β Forwarded to the API service.
2οΈβ£ Authorization
β API service verifies permissions via IAM (Identity and Access Management).
3οΈβ£ Bucket metadata creation
β API service records the new bucket in the metadata store.
β
Success response is returned.
4οΈβ£ File upload begins
β Client uploads script.txt
via another PUT
request.
5οΈβ£ Validation again
β API checks if user has WRITE access to the target bucket.
6οΈβ£ Object data storage
β Payload is stored in the data store.
β A UUID is generated for the object.
7οΈβ£ Object metadata registration
β API creates an entry in the metadata database with details:
-
object_id
(UUID) -
bucket_id
-
object_name
, and more.
π§ Why It Matters
This separation of metadata and object data, combined with strict identity checks and immutability, gives object storage:
- π Extreme scalability
- π Strong security controls
- π Easy versioning & lifecycle management
- βοΈ Cloud-native architecture suited for cold data, backups, and media
π¬ Have you worked with S3 or any S3-compatible services like MinIO, DigitalOcean Spaces, or Backblaze B2?
Would love to hear about your experiences or pain points!
Top comments (0)