Amazon S3 (Simple Storage Service)
Amazon S3 is an object storage service that offers industry-leading scalability, data availability, security, and performance. Unlike traditional file systems, S3 stores data as objects within buckets.
🏗️ Core Concepts
To master S3, you must understand three fundamental building blocks:
- Buckets: Containers for objects. Bucket names are globally unique across all of AWS.
- Objects: The fundamental entities stored in S3. An object consists of the file data and any metadata describing it.
- Keys: The unique identifier for an object within a bucket. Think of it as the "full path" to the file (e.g.,
images/logo.png).
💰 Storage Classes & Cost Optimization
S3 offers various storage classes tailored for different access patterns. Choosing the right one can save you thousands in cloud costs.
| Storage Class | Use Case | Durability | Availability |
|---|---|---|---|
| S3 Standard | Frequently accessed data. | 99.999999999% | 99.99% |
| S3 Intelligent-Tiering | Data with unknown access patterns. | 99.999999999% | 99.9% |
| S3 Standard-IA | Infrequently accessed data (Long-lived). | 99.999999999% | 99.9% |
| S3 One Zone-IA | Non-critical, infrequent data. | 99.999999999% | 99.5% |
| S3 Glacier | Archival (Retrieval: Minutes/Hours). | 99.999999999% | 99.99% |
🔐 S3 Security & Reliability
S3 is built to be secure by default, but you must configure your "Safety Switches" correctly.
1. Block Public Access
By default, all new buckets have "Block Public Access" enabled. This prevents accidental exposure of your data to the internet. Never disable this unless you are hosting a public-facing static website.
2. Versioning
Enabling versioning allows you to keep multiple variants of an object in the same bucket. It is your primary defense against accidental deletions or overwrites.
3. Bucket Policies
JSON-based policies that define who can access your bucket and what they can do (e.g., Allowing a specific IAM user to upload files).
🌍 Popular Use Cases
- Static Website Hosting: Host high-performance, low-cost websites directly from a bucket.
- Data Lakes: Store massive amounts of raw data for AI and analytics.
- Backup & Restore: Use S3 as a highly durable target for on-premise or cloud backups.
- Media Hosting: Serving images and videos for web applications.
[!TIP] Durability vs. Availability S3 is designed for 11 nines of durability (99.999999999%). This means if you store 10,000,000 objects in S3, you can expect to lose a single object once every 10,000 years!