Sub topic 1
What object storage is and where S3 fits
Prerequisites
This chapter assumes you can:
- Run commands in a terminal and read short Python snippets.
- Read an HTTP request and response, including verbs such as GET and PUT and status codes such as 200 and 404.
- Describe what an AWS account is and how an IAM user or role signs requests.
You do not need to have used S3 before. Later chapters cover creating buckets, access control, encryption and cost in detail. This chapter builds the working model that those chapters rely on.
Three ways to store data
Applications keep data in one of three kinds of storage. They differ in how you address data and what operations you can perform on it.
- Block storage exposes a raw device made of fixed-size blocks. An operating system formats it with a file system and mounts it. Examples are Amazon EBS volumes and local disks. It is the right choice for boot volumes and databases that need low-latency random reads and writes.
- File storage exposes a hierarchy of directories and files through a protocol such as NFS or SMB. Many machines can mount it and use ordinary file operations, including appending to a file and renaming a directory. Examples are Amazon EFS and Amazon FSx.
- Object storage exposes a flat collection of objects through an HTTP API. You store and fetch whole objects by name. There is no device to mount and no file system to manage. Amazon S3 is AWS's object storage service.
| Property | Block | File | Object (S3) |
|---|---|---|---|
| Unit of storage | Fixed-size block | File in a directory | Whole object |
| Access method | Attached to one instance (usually) | Mounted over NFS or SMB | HTTP API, CLI or SDK |
| Partial update | Yes, any block | Yes, any byte range | No, you replace the whole object |
| Typical latency | Sub-millisecond to milliseconds | Milliseconds | Tens of milliseconds to first byte |
| Scale | Size of the volume | Large, but bounded by the file system | Effectively unlimited objects |
| Best for | Databases, boot disks | Shared home directories, legacy apps | Backups, media, logs, data lakes, static assets |
What an object is
An object is a bundle of three things:
- The data, a sequence of bytes. S3 does not interpret it. It can be a JPEG, a CSV, a compressed archive or an encrypted blob.
- A key, the unique name of the object inside its bucket, for example
reports/2026/report.csv. - Metadata, name-value pairs describing the object. Some are set by S3, such as size, last-modified time and ETag. Others are set by you, such as
Content-Typeor customx-amz-meta-*entries.
Objects live in a bucket, which is a named container. A bucket holds any number of objects, and a single object can be up to 5 TB. The bucket is the unit where you apply most settings: Region, access policy, encryption defaults, versioning and lifecycle rules.
The most important consequence of this model is that an object is immutable as stored. You cannot change byte 500 of an object or append a line to it. To change an object, you upload a complete new object with the same key. S3 then replaces the old one (or keeps it as an older version if versioning is on).
A flat namespace that looks like folders
S3 has no real directories. A bucket is a flat map from key to object. The console and tools show folders because keys often contain slashes, and clients can group keys by a delimiter.
Consider these three keys:
reports/2026/january.csvreports/2026/february.csvimages/logo.png
The text reports/2026/ is a prefix, a leading part of the key. It is not a directory that exists independently. When you list with Prefix="reports/" and Delimiter="/", S3 returns matching keys and groups deeper keys into "common prefixes", which clients display as folders.
Two practical effects follow:
- Creating a "folder" in the console actually uploads a zero-byte object whose key ends in
/. Deleting all the files in a folder does not remove a folder, because none existed. - Renaming a "folder" is not a single operation. You copy every object to a new key and delete the old one, which takes time proportional to the number of objects.
How you talk to S3
S3 is a web service. Every operation is an HTTP request to an endpoint, and every request is signed with AWS credentials (Signature Version 4). The CLI and SDKs build and sign these requests for you.
The core operations map to HTTP verbs:
| Operation | HTTP request | Purpose |
|---|---|---|
| PutObject | `PUT /key` | Upload an object |
| GetObject | `GET /key` | Download an object, optionally a byte range |
| HeadObject | `HEAD /key` | Read metadata without the body |
| DeleteObject | `DELETE /key` | Remove an object |
| ListObjectsV2 | `GET /?list-type=2&prefix=...` | List keys, up to 1,000 per call |
This is a different mental model from file I/O. You make a network call for each operation, so many small requests cost more time and money than a few large ones. Byte-range GETs let you read part of an object, and multipart upload (covered in a later chapter) lets you send a large object in pieces. Neither lets you edit an object in place.
The diagram shows a typical request path for an application that stores and retrieves a report.
What S3 is good at
S3 suits data that is written once or rarely changed and read as whole objects. Common uses:
- Backups and archives. Cheap, durable and easy to expire on a schedule.
- Static assets and media. Images, video and downloads, often fronted by a CDN.
- Logs and exports. Many producers write new objects, and batch jobs read them later.
- Data lakes. Analytics engines such as Athena, EMR and Redshift Spectrum read objects directly from S3.
- Application artifacts. Build outputs, machine learning models and container layers.
S3 provides:
- Durability. AWS designs S3 for 99.999999999% (eleven nines) durability of objects, by storing data redundantly across multiple facilities. A later chapter explains what that number does and does not promise.
- Scale without capacity planning. You do not provision storage. You pay for what you store and the requests you make.
- Integration. IAM, encryption, event notifications and many AWS services work with S3 directly.
What S3 is not good at
Choosing S3 for the wrong workload is a common and expensive mistake.
- Databases and transactional workloads. Frequent small updates to part of a record need block storage or a database service. S3 only replaces whole objects.
- Applications that expect a POSIX file system. Tools that append to files, take file locks or rename directories atomically do not map to S3. Mounting S3 through a FUSE-style adapter hides the differences but does not remove them, and performance and semantics surprise people.
- Very low latency access. First-byte latency is in the tens of milliseconds. A cache or a different store is better for sub-millisecond reads.
- Many tiny objects accessed individually. Each object costs a request, and request charges and latency dominate. Combine small items into larger objects when you can.
A quick decision guide:
| If you need to... | Consider |
|---|---|
| Boot an instance or run a database on a disk | EBS (block) |
| Share a writable directory tree among many servers | EFS or FSx (file) |
| Store large amounts of data cheaply and read whole items | S3 (object) |
| Query individual records with indexes | A database such as DynamoDB or RDS |
Common mistakes
- Treating prefixes as folders with their own settings. Prefixes have no existence of their own. You can scope some policies and lifecycle rules by prefix, but you cannot set permissions on an "empty folder".
- Expecting in-place edits. Code that downloads, modifies and re-uploads the whole object can lose updates if two writers race. S3 stores the last write for a key.
- Assuming the bucket is a global-looking, Region-less thing. A bucket name is unique across the S3 partition, but the bucket itself lives in one Region. The next chapter covers this.
- Listing to find things. Listing is paged at 1,000 keys per call and is slow for very large buckets. Design key names so that you know the key you need, or keep an index elsewhere.
Summary
S3 stores whole objects, each identified by a key in a bucket and accessed over an authenticated HTTP API. It trades the in-place editing and low latency of block and file storage for nearly unlimited scale, high durability and low cost. Keys form a flat namespace, and prefixes are only a naming convention that tools display as folders.
Exercise
An application writes a 2 GB log file and wants to add one line to the end every minute. A teammate proposes keeping the log in S3 and "appending" to it. Explain why this does not work as proposed, and name one alternative design that fits S3.
Show answer
S3 objects cannot be modified in place. Each change means uploading a complete new 2 GB object under the same key, which is slow and expensive and can lose updates if two writers overlap. A better design writes a small new object per interval or batch, for example logs/2026/11/26/19-24.log, and lets a batch job or lifecycle rule combine or expire them later. Alternatively, write the log to block or file storage and copy completed files to S3.
Exercise
You create the key reports/2026/january.csv and list the bucket with Prefix="reports/" and Delimiter="/". What does S3 return, and does a folder named reports exist?
Show answer
S3 returns no matching keys at that level and one common prefix, reports/2026/, because the object's key continues past the next delimiter. No folder exists. reports/ and reports/2026/ are only leading parts of the key, which clients display as folders.