Post

18. S3

18. S3

S3 (Amazon Simple Storage Service)


Prerequisites


1. S3

"aws-s3-01"

Amazon S3 (Simple Storage Service) is an object storage service that provides:

  • High durability (99.999999999%)
  • Scalability (virtually unlimited)
  • High availability
  • Simple API-based access

πŸ‘‰ In short:

S3 is a storage for files (objects), not servers

1-1. Bucket

  • Container for storing objects
  • Must have globally unique name

πŸ‘‰ Example:

1
2
my-app-images
my-backup-data

1-2. Object

  • Actual data stored in S3
  • Consists of:

    • File (data)
    • Key (path)
    • Metadata

πŸ‘‰ Example:

1
Key: images/profile.png

1-3. Key (Path)

S3 doesn’t have real folders πŸ‘‰ it uses key as virtual path

1
2
3
bucket
 └── images/
      └── profile.png

πŸ‘‰ Actually:

1
images/profile.png

1-4. Important Characteristics

Durability
  • 99.999999999% (11 nines)
Scalability
  • Unlimited storage
No server management

πŸ‘‰ No EC2 required

2. How to work S3

1
2
3
4
5
6
7
Client (App / Browser)
        ↓
      Internet
        ↓
      S3 Bucket
        ↓
    Object Storage
  1. Upload file β†’ S3
  2. S3 stores as object
  3. Access via:

    • URL
    • SDK (C++, Python, etc.)
1
2
3
4
5
6
7
EC2 / Backend
    ↓
 Download from S3
    ↓
 Load into Memory
    ↓
 Process

2-1. Security

IAM Policy
  • Controls access via AWS IAM
Bucket Policy
  • Controls public/private access
ACL (Legacy)
  • Old method (not recommended)

2-2. Real Use Cases

Static Website Hosting
  • HTML / CSS / JS hosting
  • Often combined with CloudFront (CDN)
Image / Video Storage
  • Profile images
  • Media files
Backup & Logs
  • DB backup
  • Server logs
Data Pipeline
  • Used with Lambda / Athena

2-3. Storage Classes

ClassUse Case
StandardFrequently accessed
Intelligent-TieringAuto optimize cost
Standard-IAInfrequent access
GlacierArchive
Glacier Deep ArchiveLong-term backup

3. How to create S3

3-1. Search S3

"aws-s3-01"

3-2. Click Navigation pane β†’ β€œGeneral purpose buckets”

"aws-s3-02"

3-3. Click Button β†’ β€œCreate bucket”

"aws-s3-03"

3-4. Step 1. General Configuration

"aws-s3-04"

3-5. Step 2. Security

"aws-s3-05"

  1. Object Ownership: Controls who owns objects in the bucket

    • Options:
      • Bucket owner enforced (Recommended) β†’ ACLs disabled, bucket owner owns everything
      • ACLs enabled β†’ Object uploader can own objects
  2. Block Public Access: Prevents public access to bucket and objects

    • Options:
      • Block all public access (Recommended) β†’ No public access allowed
  3. Bucket Versioning: Keeps multiple versions of the same object

    • Options:
      • Disable β†’ Only latest version exists
      • Enable β†’ Stores all versions

3-6. Step 3. Security

"aws-s3-06"

3-7. Upload Data

"aws-s3-07" "aws-s3-08"

4. S3 vs EBS vs EFS

FeatureS3EBSEFS
TypeObjectBlockFile
Attach to EC2βŒβœ…βœ…
AccessHTTPOS diskNetwork FS
Use caseFile storageOS / DBShared storage
This post is licensed under CC BY 4.0 by the author.