How Amazon S3 Stores Billions of Objects
- Author
- Prathamesh Patil
- Length
- 2103 words
- Read
- 10 min
Key takeaways
Amazon S3 is a flat key-value store. A bucket plus an object key identifies every object; "folders" are just key prefixes and a delimiter used at list time.
The public contract is simple: put, get, list, and delete objects over HTTPS. Everything that makes S3 scale — partitioning, replication, repair — sits behind that contract.
S3 delivers strong read-after-write consistency for object writes, overwrites, deletes, and list operations. Bucket configuration changes are the documented exception.
Request capacity scales per key prefix. AWS tells you to spread hot workloads across prefixes, retry with backoff, and parallelize with multipart upload and byte-range reads.
Durability comes from storing data redundantly across multiple Availability Zones in a Region (except the One Zone storage classes), plus continuous integrity checking.
Research basis
This teardown is grounded in public AWS documentation: the Amazon S3 User Guide (what S3 is, how it works, and its data consistency model), the S3 performance design patterns guide, the S3 FAQs, and the storage classes overview. AWS does not publish the internal service topology of S3. Where this article describes internal components — request routers, index services, storage nodes — it is a reasoned model of how a system with S3's public guarantees has to behave, not a description of AWS source code. Those passages say so explicitly.
Quick overview
From the outside, S3 is three concepts: buckets, objects, and keys.
A bucket is a container that lives in one AWS Region. An object is the data plus its metadata. A key is the object's full name inside the bucket. There is no directory tree. The key photos/summer/beach.jpg is a single string; the console only renders it as nested folders because it splits on the / delimiter when listing.
That flat namespace is the most important design decision in S3. A directory tree forces the system to keep parent and child entries consistent on every create, rename, and delete. A flat key space lets the service partition objects by key range and move those ranges around without touching any parent record.

You reach a bucket through its regional endpoint, either with a virtual-hosted-style hostname (bucket-name.s3.region.amazonaws.com) or through an S3 Access Point, which gives a named network endpoint with its own access policy on top of the same bucket.
Architecture
The public documentation describes behavior, not boxes. Still, the behavior constrains the shape of the system enough to sketch a useful model. The components below are an inferred model, named for what they must do.

Request front end. Terminates HTTPS, parses the REST call, and is horizontally scalable because it holds no durable state.
Authentication and policy evaluation. Every request is signed. The front end verifies the signature and evaluates IAM policies, bucket policies, Access Point policies, and Block Public Access settings before any data moves. This is documented behavior; where it runs internally is not.
Key index and metadata service. Maps bucket plus key to the object's current version and where its bytes live. Strong consistency for reads and lists means this index must be updated atomically when a write is acknowledged.
Placement and partition map. Decides which storage nodes hold which pieces of data. The performance guide's advice about prefixes implies the index is partitioned by key range and that partitions split as request rates grow.
Storage nodes. Hold object bytes across multiple Availability Zones. Redundancy across zones is documented for S3 Standard and most other storage classes.
Integrity check and repair. AWS documents that S3 verifies data integrity with checksums and repairs lost redundancy. A background process must keep scanning, detecting bad copies, and rebuilding them.
Separating the index from the bytes is the key move. Metadata operations are small and frequent; data operations are large and bandwidth-bound. Scaling them independently lets each tier use hardware suited to its job.
Request flow
Here is the path of a PUT followed by a GET, using the model above.

The ordering matters. The bytes must be durable before the index points at them, and the index must be committed before the client hears success. That ordering is what lets S3 promise that a GET issued after a successful PUT returns the new object, and that a LIST includes it.
For large objects, multipart upload splits the write into independently uploaded parts that S3 assembles when you complete the upload. Parts can be retried individually and uploaded in parallel, which is how clients push large files efficiently over many connections. On the read side, byte-range fetches let a client pull different ranges of the same object in parallel.
Data flow and durability
Durability in S3 is a property of placement plus repair, not of any single disk.

What AWS documents:
S3 Standard and the other multi-zone storage classes store data redundantly across at least three Availability Zones in a Region. The One Zone storage classes keep data in a single zone and trade resilience for price.
S3 computes and validates checksums on upload and supports additional checksum algorithms you can supply yourself, so corruption in transit is caught before the write is acknowledged.
S3 detects and repairs lost redundancy in the background.
What AWS does not document is whether a given object is stored as full replicas, erasure-coded fragments, or a mix. Erasure coding is the economical choice for cold data at this scale, but treat that as inference.
On top of that platform layer, you choose your own protection: versioning keeps prior versions after overwrites and deletes, S3 Object Lock enforces write-once-read-many retention, and replication copies objects to another bucket in the same or a different Region.
Consistency model
Older articles — and the original draft of this one — say S3 is eventually consistent for overwrites and deletes. That is out of date. The S3 User Guide documents strong read-after-write consistency for all PUT and DELETE requests on objects, and for list operations, in every Region.
Two details still trip people up:
Concurrent writers. S3 does not lock objects for concurrent writers. If two clients write the same key at the same time, the request with the latest timestamp wins. If you need coordination, use conditional writes or build locking on top.
Bucket configuration. Changes such as deleting a bucket or updating some bucket configurations are eventually consistent. A deleted bucket name can still appear in a list for a short time.
The architectural lesson is that strong consistency did not require a global lock. It required the key index to become the single authority for "what is the current version of this key," with writes committed through it.
Scaling by prefix
S3 does not ask you to provision capacity. It does ask you to shape your keys sensibly.
The performance design patterns guide says request capacity applies per partitioned prefix, that there is no limit on the number of prefixes in a bucket, and that S3 scales a prefix's capacity automatically as its request rate grows. While it scales, you can receive Slow Down errors; the documented response is to retry with exponential backoff.

The practical guidance from AWS:
Spread high-rate workloads across multiple prefixes so they land on different partitions.
Parallelize: many connections, multipart uploads, and byte-range reads.
Retry throttled and failed requests with exponential backoff and jitter.
Keep clients in the same Region as the bucket, and use Amazon CloudFront when the same objects are read repeatedly by users far from that Region.
The inferred mechanism is range partitioning of the key index. A partition that gets hot splits along key boundaries, and the halves move to separate servers. That explains both the per-prefix guidance and the temporary Slow Down errors during a split.
Failure domains and blast radius
S3 is built in layers of isolation, and each layer contains a different kind of failure.
Region. A bucket lives in exactly one Region. A regional problem affects only buckets in that Region. Cross-Region Replication is the documented way to keep a copy elsewhere.
Availability Zone. Multi-zone storage classes survive the loss of a zone because redundant data lives in other zones. One Zone classes do not, by design.
Storage node or disk. Individual hardware failures are routine at this scale. Background repair rebuilds lost redundancy from surviving copies without client involvement.
Index partition. A hot or failing partition affects the key range it owns, not the whole bucket. That is another reason to spread load across prefixes.
Client. Throttling and transient errors are part of the contract. Well-behaved clients retry with backoff; badly behaved ones amplify problems with tight retry loops.
The common pattern is that each tier assumes the one below it will fail and is designed to keep serving when it does.
Data-store tradeoffs
S3's design makes deliberate choices that are worth naming before you build on it.
Objects, not files. You replace whole objects; there is no in-place append or partial overwrite. This keeps the consistency story simple and pushes file-system semantics to the client or to services like Amazon EFS.
Flat keys, not directories. Listing a "folder" is a prefix scan. Renaming a folder means copying and deleting every object under it.
Last writer wins. No built-in locking keeps writes cheap, but concurrent updates to one key need coordination you design yourself.
Elastic partitions, not provisioned throughput. You never size a cluster, but sudden, extreme load on one prefix can see Slow Down responses until S3 rebalances.
Storage classes as a dial. Durability stays the same across most classes while availability, retrieval time, and price change. Lifecycle rules move objects down the dial as they age.
What I would steal
If I were building a large blob store, these are the S3 ideas I would copy:
A flat namespace. It turns metadata scaling into a key-range partitioning problem instead of a tree-consistency problem.
Separate index and bytes. Small, hot metadata and large, cold data scale on different hardware and different curves.
Commit through one authority. A single index commit per write is what makes strong read-after-write consistency possible without global locks.
Repair as a background loop. Assume disks and nodes fail constantly and make rebuilding redundancy a continuous process, not an incident.
Make throttling part of the contract. Documented backoff behavior turns overload into a recoverable signal instead of a cascading failure.
Expose cost and resilience as storage classes. Let users pick their tradeoff per object instead of per cluster.
FAQ
How does Amazon S3 store billions of objects? S3 uses a flat key namespace inside each bucket and partitions its key index by key range, splitting partitions as load grows. Object bytes are stored redundantly across multiple Availability Zones and repaired in the background.
Is Amazon S3 strongly consistent? Yes. S3 provides strong read-after-write consistency for object writes, overwrites, deletes, and list operations in all Regions. Some bucket configuration changes remain eventually consistent.
What is an S3 prefix and why does it matter for performance?
A prefix is the leading part of an object key, such as logs/ in logs/app.json. S3 applies request capacity per partitioned prefix, so spreading heavy workloads across prefixes lets S3 serve them in parallel.
How does S3 protect against data loss? Multi-zone storage classes keep redundant data in at least three Availability Zones, S3 validates checksums and repairs lost redundancy automatically, and you can add versioning, Object Lock, and replication on top.
Does Amazon S3 support folders?
No. Folders in the console are a display convention built from key prefixes and the / delimiter. Every object is stored under a single flat key.
Related reading
How AWS Regions and Availability Zones work — the failure domains S3 builds on.
How Amazon RDS handles database failover — a contrasting approach to durability for relational data.
How AWS Lambda executes millions of functions — a common S3 event consumer.
How Instagram handles billions of photos — object storage at application scale.
How AWS CloudFront works — caching S3 objects close to users.
Sources
Image credits
- Cover: AI-generated illustration