AWS S3 — Simple Storage Service
Before you start: basic AWS familiarity (Regions, and what an IAM role/policy does — see the AWS Core Services Overview and IAM courses first if those are new) is assumed, since bucket policies and access control below reference IAM concepts directly. No prior storage or file-system administration experience is needed.
S3 is AWS's object storage service — infinitely scalable, 11 nines of durability (99.999999999%), and the foundation of data lakes, static websites, application artifacts, and backups across millions of AWS workloads.
Why this exists (the hook)
Every app eventually needs to store files somewhere that isn't the server's own disk — user uploads, log archives, build artifacts, database backups. Put them on the server's local disk and you're one instance failure away from losing them, and you can't share them across instances anyway. S3 solves this: durable, shared, HTTP-accessible storage that isn't tied to the lifecycle of any single machine.
Analogy — Think of S3 like a giant, infinitely large self-storage warehouse, not a filing cabinet. There's no folder structure enforced by the building — every unit (object) is found by its full label (key), like unit-A-shelf-3-box-12. The warehouse company (AWS) guarantees your stuff won't be lost (11 nines durability) and gives you a front desk (the HTTP API) to drop off or pick up items — but the "folders" you see when browsing are just common prefixes in the label, not real physical divisions.
Diagram — how a request reaches an object:
Annotated example — uploading and reading back one object end to end:
Try it (2 minutes) — If you have AWS CLI access to a sandbox account, create a bucket and confirm the "no real folders" claim yourself:
No AWS access handy? Reason through it instead: if a/b/c/README.md is the only object whose key starts with a/, what happens to the apparent "a/" folder in the console once that object is deleted?
Core Concepts
Object storage — Not a filesystem. You store objects (files) identified by a key (path-like string). No directories — just objects with key names that look like paths. Ideal for: write once, read many access patterns.
Bucket — Container for objects. Globally unique name across all AWS accounts. Region-specific.
Object — A file + metadata. Maximum 5TB per object. Each object has: Key (name), Value (data), Metadata, Version ID, Access Control.
Key — The full "path" to the object: logs/2024/01/app.log. The / is just part of the name — not a real folder.
S3 vs EBS vs EFS
| S3 | EBS | EFS |
|---|
|--|--|--|--|
| **Type** | Object storage | Block storage | Shared filesystem |
|---|---|---|---|
| Access | HTTP API / SDK | Single EC2 at a time | Multiple EC2 instances |
| Use for | Backups, data lake, static files | OS disk, databases | Shared app content |
| Durability | 99.999999999% | 99.8%–99.9% (gp2/gp3); 99.999% for io2 | 99.999999999% |
| Latency | Milliseconds | Sub-millisecond | Milliseconds |
| Cost | Cheapest | Medium | Most expensive |
Storage Classes
| Class | Use Case | Retrieval | Cost |
|---|
|-------|---------|-----------|------|
| **Standard** | Frequently accessed | Instant | Highest |
|---|---|---|---|
| Standard-IA | Infrequently accessed | Instant | ~40% cheaper than Standard (needs verification — check current AWS S3 pricing page for exact figure) |
| One Zone-IA | Non-critical, single AZ | Instant | ~20% cheaper than IA (needs verification — check current AWS S3 pricing page for exact figure) |
| Glacier Instant | Archives accessed quarterly | Instant | Low |
| Glacier Flexible | Archives accessed yearly | Minutes-hours | Very Low |
| Glacier Deep Archive | Compliance, 7+ year retention | 12–48 hours (needs verification — exact retrieval-tier timing changes over time, check current AWS docs) | Lowest |
| Intelligent-Tiering | Unknown access patterns | Instant | Auto-optimizes |
Essential Operations
S3 Security
Lifecycle Policies
boto3 — Python SDK
S3 Event Notifications
Interview Questions
Explain S3 consistency model.
Since December 2020, S3 provides strong read-after-write consistency for all operations — PUT, GET, LIST, DELETE. Previously, eventually consistent for some operations. Now: if you write an object and immediately read it, you will see the new version. If you delete an object and list the bucket, the deleted object won't appear. This applies to all S3 regions and all object types.
What is S3 Transfer Acceleration?
Transfer Acceleration uses AWS CloudFront's globally distributed edge locations to speed up uploads to S3. Instead of uploading directly to S3 in one region, data travels over the public internet to the nearest CloudFront edge, then over AWS's optimized network backbone to S3. Useful for users geographically far from your S3 bucket's region. Has an additional cost per GB.
How do you secure an S3 bucket used for a static website?
Use CloudFront in front of S3 — never expose S3 directly. Block all public access on the S3 bucket. Use Origin Access Control (OAC) so only CloudFront can access S3. Enable bucket versioning for recovery. Enable server-side encryption. Enable access logging. Set up CloudFront WAF for DDoS protection. Use presigned URLs for any private content access.

