Storage Types#

AWS offers storage at different layers — block, file, and object — each optimized for different access patterns:

flowchart TD
    Storage["AWS Storage"]
    Storage --> Block["Block Storage<br>(EBS, Instance Store)"]
    Storage --> Object["Object Storage<br>(S3, S3 Glacier)"]
    Storage --> File["File Storage<br>(EFS, FSx)"]
    
    Block --> |"Attached to EC2"| Disk["Like a hard drive"]
    Object --> |"HTTP API"| Bucket["Like a file server with infinite capacity"]
    File --> |"NFS/SMB"| Share["Like a network share"]

S3 (Simple Storage Service)#

Object storage with virtually unlimited capacity. The most-used AWS service.

Core Concepts#

ConceptDescription
BucketContainer for objects (globally unique name)
ObjectFile + metadata (up to 5 TB)
KeyFull path to the object within a bucket
Version IDUnique ID when versioning is enabled

Storage Classes#

ClassAccess PatternDurabilityCost
StandardFrequent access99.999999999% (11 9s)$$$
Intelligent-TieringUnknown/changing11 9sAuto-optimized
Standard-IAInfrequent (monthly)11 9s$$ (retrieval fee)
One Zone-IAInfrequent, non-critical11 9s (single AZ)$
Glacier InstantArchive, instant access11 9s$
Glacier FlexibleArchive, minutes-hours11 9s¢
Glacier Deep ArchiveLong-term archive (12hr)11 9s¢¢

S3 Features#

flowchart LR
    Upload["Upload Object"] --> Encrypt["Encryption<br>(SSE-S3, SSE-KMS)"]
    Encrypt --> Version["Versioning<br>(keep all versions)"]
    Version --> Lifecycle["Lifecycle Rules<br>(auto-transition classes)"]
    Lifecycle --> Replicate["Replication<br>(cross-region backup)"]

Lifecycle rules automate cost optimization:

Day 0:   Standard (frequent access)
Day 30:  → Standard-IA (infrequent)
Day 90:  → Glacier Flexible (archive)
Day 365: → Deep Archive (compliance)
Day 730: → Delete

Access Control#

MechanismScopeUse Case
Bucket PolicyBucket-levelCross-account access, public access
IAM PolicyUser/Role-levelInternal access control
ACLsObject-level (legacy)Avoid — use policies instead
Block Public AccessAccount/BucketSafety net against accidental exposure

S3 Use Cases#

  • Static website hosting
  • Data lake storage
  • Backup and disaster recovery
  • Log storage and analytics
  • Application assets (images, videos)
  • Terraform state backend

EBS (Elastic Block Store)#

Network-attached block storage for EC2 instances — like a virtual hard drive.

Volume Types#

TypeIOPSThroughputUse Case
gp33,000-16,000125-1,000 MB/sGeneral purpose (default)
gp2Burst to 3,000128-250 MB/sLegacy general purpose
io2Up to 64,0001,000 MB/sHigh-performance databases
st1500500 MB/sBig data, log processing
sc1250250 MB/sCold storage, infrequent

EBS Characteristics#

  • AZ-scoped — volume must be in same AZ as EC2 instance
  • Snapshots — point-in-time backups stored in S3 (cross-AZ, cross-region)
  • Encryption — AES-256, transparent to the instance
  • Resizable — increase size without downtime
  • Detachable — move between instances in same AZ

EFS (Elastic File System)#

Managed NFS file system that multiple EC2 instances can mount simultaneously:

flowchart TD
    subgraph AZ1["AZ 1a"]
        EC2a["EC2 Instance A"]
    end
    subgraph AZ2["AZ 1b"]
        EC2b["EC2 Instance B"]
    end
    subgraph AZ3["AZ 1c"]
        EC2c["EC2 Instance C"]
    end
    
    EFS["EFS File System<br>(shared across AZs)"]
    
    EC2a --> EFS
    EC2b --> EFS
    EC2c --> EFS
FeatureEBSEFS
ProtocolBlock (attached)NFS (network mount)
Multi-attachNo (usually)Yes (many instances)
ScopeSingle AZMulti-AZ
ScalingManual resizeAutomatic (petabyte scale)
CostLower (per GB provisioned)Higher (per GB used)
Use caseBoot volumes, databasesShared content, CMS, ML data

Choosing Storage#

NeedServiceWhy
Boot volume for EC2EBS gp3Block storage, fast, persistent
High-IOPS databaseEBS io2Consistent low-latency
Shared files across instancesEFSNFS mount, multi-AZ
Unlimited object storageS3Scalable, durable, cheap
Static websiteS3 + CloudFrontNo servers needed
Backup/archiveS3 GlacierLowest cost for cold data
Temporary high-speedInstance StoreEphemeral, highest IOPS

Key Takeaways#

  1. S3 for everything that isn’t a disk — objects, backups, logs, static sites, data lakes
  2. EBS gp3 is the default — better price/performance than gp2
  3. EFS for shared access — when multiple instances need the same files
  4. Use lifecycle rules — automatically move data to cheaper tiers
  5. Enable versioning — protect against accidental deletion
  6. Encrypt everything — SSE-KMS for S3, encryption for EBS
  7. Block public access by default — enable only when intentionally hosting public content