# DVA C02 Notes - Storage 

## EBS (Elastic Block Store)

*   AZ-scoped storage (tied to one AZ)
    
*   Can move across AZ/region using **snapshots**
    
*   Block storage (like a disk)
    
*   Attached to EC2 → needs filesystem (ext4/xfs)
    

### Multi-Attach

*   Only **io1/io2**
    
*   Same AZ only
    
*   Max **16 instances**
    
*   Supports concurrent read/write
    
*   ❗ Requires **cluster-aware filesystem** (AWS doesn’t handle locking)
    

## EFS (Elastic File System)

*   Regional service (**multi-AZ by default**)
    
*   File storage (NFS)
    
*   Can be mounted to **100s of EC2 instances at the same time**
    
*   Linux only
    
*   Auto-scaling (capacity planning available via provisioned option)
    
*   Higher cost than EBS
    
*   Lifecycle policies used to move data to cheaper tier based on Last accessed.
    

## Instance Store (Ephemeral Storage)

*   Physically attached storage to EC2 instance
    
*   Provides very low latency and high IOPS
    
*   Ephemeral (temporary storage)
    

Data behavior:

*   Lost on instance STOP or TERMINATION
    
*   NOT lost on reboot
    

Key characteristics:

*   No persistence
    
*   No snapshots or backup
    
*   Not detachable or reusable
    

Use cases:

*   Caching (Redis, Memcached)
    
*   Temporary / scratch data
    
*   Buffer storage
    
*   HPC intermediate processing
    

Key decision rule:

*   Use Instance Store when data can be LOST
    
*   Use EBS when data MUST persist
    

## One Liner

*   Single instance → EBS
    
*   Multi-instance, same AZ → Multi-Attach EBS
    
*   Multi-instance, cross-AZ → EFS
    
*   Shared file system without management → EFS
    
*   EBS => One server mindset
    
*   EFS = Shared storage mindset
    
*   Instance storage **Highest I/O performance among EC2-attached storage**
    
    *   No network overhead (physically attached)
        
    *   Very low latency
