What is S3?
S3 stands for Simple Storage Service. It's AWS's object storage solution — think of it as an infinitely large hard drive in the sky. You can store any amount of data and access it from anywhere on the internet.
Unlike a regular hard drive, S3 doesn't have folders in the traditional sense. Everything is stored as objects (files) in buckets (containers). It's more like a filing cabinet where each drawer is a bucket and each folder tab is a prefix.
Key Features of S3
Durability is incredible — S3 stores your data across multiple facilities and guarantees 99.999999999% (11 nines) durability. If you store 10 million objects, you can expect to lose roughly one every 10,000 years.
Scalability means S3 grows with you automatically. Store 1 KB or 1 PB, and the performance stays consistent. You never have to worry about running out of space or managing capacity.
Security is built in with encryption at rest and in transit, access controls, and audit logging.
Storage Classes
S3 offers different storage classes based on how often you access your data. S3 Standard is for frequently accessed data. S3 Standard-IA (Infrequent Access) is cheaper but charges for retrieval. S3 Glacier is for archival storage — super cheap but takes hours to retrieve.
You can also set up lifecycle policies to automatically move objects between storage classes. For example, move files to Glacier after 90 days of inactivity. It's like having a robot file clerk who organizes your data for you.
Common S3 Operations
The AWS CLI makes working with S3 straightforward. Here are some essential commands:
aws s3 mb s3://my-new-bucket --region us-east-1
aws s3 cp myfile.txt s3://my-bucket/
aws s3 sync ./local-folder s3://my-bucket/remote-folder
aws s3 ls s3://my-bucket/
The cp command copies files, sync keeps directories in sync, and ls lists bucket contents. These four commands cover most day-to-day S3 tasks.
Static Website Hosting
S3 can host static websites — HTML, CSS, JavaScript, and images. Just enable the static website hosting feature, upload your files, and set the permissions. It's one of the cheapest ways to host a website on the internet.
Combined with CloudFront (AWS's CDN), your static site loads fast anywhere in the world. Many companies host their marketing pages this way — fast, cheap, and virtually maintenance-free.