You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Introduction to Amazon S3
Introduction to Amazon S3
Amazon Simple Storage Service (S3) is one of the oldest and most widely used AWS services. Launched in 2006, S3 provides virtually unlimited object storage with industry-leading durability, availability, and performance. Whether you are storing application assets, backing up critical data, or hosting a static website, S3 is almost certainly part of your architecture.
What Is Object Storage?
Before diving into S3, it helps to understand the difference between the three main storage models used in cloud computing:
| Storage Model | Data Unit | Access Method | Example |
|---|---|---|---|
| Block storage | Fixed-size blocks | Mounted as a volume (like a hard drive) | Amazon EBS |
| File storage | Files in a hierarchy | Network file system (NFS/SMB) | Amazon EFS |
| Object storage | Objects (file + metadata) | HTTP API (PUT, GET, DELETE) | Amazon S3 |
Object storage treats every piece of data as a discrete object composed of three parts:
- Data — the file content itself (an image, a log file, a video, etc.)
- Metadata — key-value pairs describing the object (content type, creation date, custom tags)
- Key — a unique identifier within the bucket (e.g.
images/photo.jpg)
Unlike file systems, there is no true directory hierarchy in S3. The "folders" you see in the console are simply prefixes in the object key.
Why S3?
S3 is the backbone of countless AWS architectures for several compelling reasons:
- Durability — S3 Standard is designed for 99.999999999% (eleven 9s) durability. That means if you store 10 million objects, you can on average expect to lose a single object once every 10,000 years.
- Availability — S3 Standard is designed for 99.99% availability.
- Scalability — There is no practical limit on the amount of data or number of objects you can store.
- Cost-effective — Multiple storage classes let you optimise cost based on access frequency.
- Security — Encryption at rest and in transit, bucket policies, ACLs, and integration with IAM.
Core Concepts
Buckets
A bucket is a top-level container for objects. Think of it as the root folder of a drive, but with a globally unique name.
- Bucket names must be globally unique across all AWS accounts.
- Buckets are created in a specific AWS Region.
- You can have up to 100 buckets per account by default (soft limit, can be increased).
Objects
An object is any file stored in a bucket. Each object consists of the data, metadata, and a unique key.
- Maximum object size: 5 TB.
- For uploads larger than 5 GB, you must use multipart upload.
- Objects are immutable — to modify a file, you upload a new version.
Keys
The key is the full path to the object within the bucket, for example:
s3://my-app-bucket/assets/images/logo.png
Here, the bucket is my-app-bucket and the key is assets/images/logo.png.
Interacting with S3
You can interact with S3 through multiple interfaces:
AWS Management Console
The web-based console lets you browse buckets, upload and download objects, and configure settings visually.
AWS CLI
The CLI is the most common way to automate S3 operations.
Create a bucket:
aws s3 mb s3://my-unique-bucket-name --region eu-west-2
Upload a file:
aws s3 cp myfile.txt s3://my-unique-bucket-name/
List objects in a bucket:
aws s3 ls s3://my-unique-bucket-name/
Download a file:
aws s3 cp s3://my-unique-bucket-name/myfile.txt ./myfile.txt
Sync a local directory to S3:
aws s3 sync ./my-folder s3://my-unique-bucket-name/my-folder
AWS SDKs
Every major programming language has an AWS SDK. For example, using the Python SDK (Boto3):
import boto3
s3 = boto3.client('s3')
# Upload a file
s3.upload_file('myfile.txt', 'my-unique-bucket-name', 'myfile.txt')
# Download a file
s3.download_file('my-unique-bucket-name', 'myfile.txt', 'downloaded.txt')
# List objects
response = s3.list_objects_v2(Bucket='my-unique-bucket-name')
for obj in response.get('Contents', []):
print(obj['Key'], obj['Size'])
S3 Pricing Overview
S3 pricing is based on several dimensions:
| Component | What You Pay For |
|---|---|
| Storage | Per GB per month, varies by storage class |
| Requests | Per 1,000 PUT, GET, LIST, etc. requests |
| Data transfer out | Per GB transferred out of S3 to the internet |
| Data transfer in | Free |
| Management features | Inventory, analytics, and Object Lock |
The Free Tier includes 5 GB of S3 Standard storage, 20,000 GET requests, and 2,000 PUT requests per month for the first 12 months.
Common Use Cases
| Use Case | Description |
|---|---|
| Static asset hosting | Serve images, CSS, JS for websites |
| Data lake | Central repository for structured and unstructured data |
| Backup and disaster recovery | Durable, low-cost storage for backups |
| Log storage | Store CloudTrail, VPC Flow Logs, application logs |
| Big data analytics | Input/output for EMR, Athena, Redshift Spectrum |
| Software delivery | Distribute build artefacts, packages, and updates |
Summary
Amazon S3 is a foundational AWS service that provides highly durable, available, and scalable object storage. Understanding the core concepts of buckets, objects, and keys — and knowing how to interact with S3 through the console, CLI, and SDKs — is essential for any AWS practitioner. In the next lesson, we will explore buckets and objects in greater depth, covering naming rules, prefixes, and metadata.