You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
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.
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:
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.
S3 is the backbone of countless AWS architectures for several compelling reasons:
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.
An object is any file stored in a bucket. Each object consists of the data, metadata, and a unique key.
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.
You can interact with S3 through multiple interfaces:
The web-based console lets you browse buckets, upload and download objects, and configure settings visually.
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
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 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.
| 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 |
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.