DEV Community

Cover image for πŸ—‚οΈ How Does an S3-Like Storage System Work Behind the Scenes?
Aditya Pandey
Aditya Pandey

Posted on

πŸ—‚οΈ How Does an S3-Like Storage System Work Behind the Scenes?

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)