AWS Simple Storage Service (S3)
Learn cloud object storage from the ground up
What You'll Learn Today:
• What is S3 and why it's revolutionary
• Core concepts: Buckets, Objects, Keys
• Storage classes for different needs
• Security, versioning, and lifecycle policies
• Hands-on practice with real scenarios
Think of S3 like a Digital Warehouse
Just like a physical warehouse stores items with unique locations, S3 stores digital files with unique addresses that you can access from anywhere in the world!
Real-World Analogy: Your Home Storage
Your House = AWS Account
Storage Rooms = S3 Buckets
Items You Store = S3 Objects
Item Locations = Object Keys
S3 is AWS's Object Storage Service that:
• Stores any type of data (photos, videos, documents)
• Offers 99.999999999% durability (11 nines!)
• Scales infinitely (no capacity planning needed)
• Provides multiple storage classes for different needs
• Is secure by default with encryption and access controls
Simple Example:
Imagine you're building a photo sharing app. S3 can store all user photos, serve them quickly to users worldwide, keep backups automatically, and do this at a fraction of the cost of running your own servers!
Think of S3 as a Digital Storage System
Every item in storage has a specific location and properties that determine how it's stored and accessed
Key Building Blocks:
1. Buckets
What: Containers for your objects
Characteristics: Globally unique names, region-specific
Example: "my-company-photos", "app-backup-2023"
2. Objects
What: The actual files you store
Characteristics: Up to 5TB in size, with metadata
Example: "vacation.jpg", "quarterly-report.pdf"
3. Keys
What: Unique identifiers for objects
Format: Like file paths ("photos/2023/january/beach.jpg")
Example: "user-uploads/profile-pics/user123.jpg"
Like Different Storage Options at Home
You store frequently used items on your desk (quick access), seasonal clothes in the closet (occasional access), and old memories in the attic (rare access). S3 offers similar options!
S3 Storage Classes:
| Class | Use Case | Access Time | Cost |
|---|---|---|---|
| Standard | Frequently accessed data | Instant | Highest |
| Intelligent-Tiering | Unknown access patterns | Instant (auto-optimizes) | Medium |
| Standard-IA | Infrequent access | Instant | Lower |
| One Zone-IA | Non-critical backups | Instant | Cheaper |
| Glacier | Long-term archives | Minutes-Hours | Very Low |
| Glacier Deep Archive | Rarely accessed | 12+ Hours | Lowest |
Cost Comparison Example:
Storing 1TB for 1 month:
• Standard: ~$23
• Glacier: ~$4
• Deep Archive: ~$1
That's up to 96% savings!
Versioning
Keep multiple versions of objects to recover from accidental deletions or overwrites
Encryption
Protect your data with server-side encryption (SSE-S3, SSE-KMS) or client-side encryption
Access Control
Manage who can access your data with IAM policies, bucket policies, and ACLs
Lifecycle Policies
Automatically transition objects to cheaper storage classes or delete them when no longer needed
Static Website Hosting
Host complete websites directly from S3 with no servers to manage
Cross-Region Replication
Automatically replicate data to another region for disaster recovery
Like Bank Security
Just as banks use multiple security layers (guards, vaults, access logs), S3 provides comprehensive protection for your data
Security Features:
1. Encryption Options
SSE-S3: AWS-managed encryption keys
SSE-KMS: Customer-managed keys with AWS KMS
SSE-C: Client-side encryption with your own keys
Client-Side: Encrypt before uploading
2. Access Control
IAM Policies: User-level permissions
Bucket Policies: Bucket-wide rules
ACLs: Legacy permissions system
Presigned URLs: Temporary access to private objects
3. Compliance Features
Block Public Access: Prevent accidental public exposure
Object Lock: Write Once Read Many (WORM) for compliance
Access Logs: Track all access requests
MFA Delete: Require multi-factor auth for deletions
Like Time Machine for Files
Versioning lets you go back in time to recover previous versions of your files, just like macOS Time Machine or Windows File History
How Versioning Works:
1. Enabling Versioning
Process: Bucket setting → Enable versioning
Effect: All new uploads create new versions
Note: Cannot be disabled, only suspended
2. Version ID Example
Original: report.txt (no version ID)
Version 1: report.txt?versionId=111111
Version 2: report.txt?versionId=222222
Version 3: report.txt?versionId=333333
Key Benefits:
• Recover from accidental overwrites or deletions
• Maintain a complete history of changes
• Implement retention policies
• Enable MFA delete for extra protection
Like Automatic File Organization
Just as you might move old documents from your desk to a filing cabinet to storage boxes over time, lifecycle rules automatically manage your S3 objects' lifecycle
Lifecycle Rules Can:
1. Transition Objects
Example: Move logs to Glacier after 30 days
Configuration: Define when to move objects between storage classes
Benefit: Automatic cost optimization
2. Expire Objects
Example: Delete temporary files after 7 days
Configuration: Set expiration period in days
Benefit: Automatic cleanup of old data
3. Manage Versions
Example: Delete non-current versions after 90 days
Configuration: Apply to current and non-current versions
Benefit: Control version storage costs
Example Lifecycle Rule:
"Rules": [
{
"ID": "MoveToGlacierAfter30Days",
"Status": "Enabled",
"Transitions": [
{
"Days": 30,
"StorageClass": "GLACIER"
}
]
}
]
}
Translation: "Move all objects to Glacier after 30 days"
Like a Digital Billboard
S3 can host your website files just like a billboard displays your message, with no need for web servers or infrastructure management
How It Works:
1. Setup Process
Step 1: Create a bucket named yourdomain.com
Step 2: Upload HTML, CSS, JS files
Step 3: Enable static website hosting in bucket properties
Step 4: Set index.html as the index document
2. Accessing Your Site
URL Format: http://[bucket-name].s3-website-[region].amazonaws.com
Example: http://my-portfolio.s3-website-us-east-1.amazonaws.com
Custom Domain: Can use Route 53 for your own domain
Perfect For:
• Personal portfolios
• Company landing pages
• Documentation sites
• Marketing pages
• Single-page applications
Mobile App Backends
Store user-generated content like photos, videos, and documents
Website Assets
Host images, videos, JavaScript, and CSS files for websites
Backup & Archive
Store database backups, system logs, and compliance documents
Data Lakes
Central repository for analytics and machine learning datasets
Media Hosting
Store and deliver video, audio, and images for media applications
DevOps Artifacts
Store build artifacts, deployment packages, and configuration files
Real-World Examples:
• Netflix stores video assets in S3
• Airbnb stores property photos in S3
• NASA stores satellite imagery in S3
• Many startups use S3 as their primary storage
What We'll Practice Today:
1. Create your first S3 bucket
2. Upload and manage objects
3. Set permissions and access controls
4. Enable versioning and test it
5. Configure a static website
6. Set up lifecycle policies
Mini Project: Personal Portfolio Website
Goal: Create and deploy a simple portfolio website using S3
Steps:
1. Create bucket named "yourname-portfolio"
2. Upload HTML, CSS, and image files
3. Enable static website hosting
4. Set permissions for public read access
5. Access your live website!
What We Learned:
• S3 is AWS's object storage service with unlimited scalability
• Buckets are containers with globally unique names
• Objects are files up to 5TB with metadata
• Storage classes optimize costs for different access patterns
• Versioning, encryption, and lifecycle policies provide data protection
• Static website hosting enables serverless web presence
Memory Aid: "B.O.S.S. Framework"
Buckets - Your containers
Objects - Your files
Storage Classes - Cost optimization
Security - Protect your data
Next Steps:
1. Create your first bucket and upload files
2. Experiment with different storage classes
3. Try hosting a simple website
4. Explore integrating S3 with other AWS services
5. Ready to learn about EC2, Lambda, and more!