Storage: Block & File
Block, file and object storage on AWS, and the services in this group (EBS, instance store, EFS and FSx).
What it is
Every application needs somewhere to keep data. AWS offers three kinds of storage, and they work very differently:
- Block storage is a raw disk, split into fixed-size blocks. The operating system formats it with a file system (ext4, XFS, NTFS) and uses it like a hard drive. It's attached to one server. On AWS: Amazon EBS volumes and EC2 instance store.
- File storage is a shared folder tree served over the network with a protocol such as NFS or SMB. Many servers read and write the same files at once. On AWS: Amazon EFS and Amazon FSx.
- Object storage keeps whole files (objects) with a key and metadata, read and written over HTTPS by any program. It scales without limit, but part of an object can't be edited in place. On AWS: Amazon S3 and S3 Glacier, covered in the Amazon S3 group.
Example
A WordPress site might use all three. Each web server boots from its own EBS volume. The uploaded images that every web server must see sit on a shared EFS file system. Nightly backups of the database go to S3.
In this group
Block storage (EBS)
EBS volumes
Network disks for EC2: AZ-bound, resizable, delete on termination.
EBS snapshots
Backups, moving data between AZs, archive, Recycle Bin, FSR.
EBS volume types
gp3, gp2, io2 Block Express, io1, st1, sc1, and how to choose.
EBS Multi-Attach
One io1/io2 volume shared by up to 16 instances.
EBS encryption
KMS encryption, and encrypting an existing volume.
Instance store
Very fast local disks that lose their data on stop.
File storage
Amazon EFS
Managed NFS for Linux, across AZs, with storage classes.
Amazon FSx
Windows File Server, Lustre, NetApp ONTAP and OpenZFS.
Choosing
EBS vs EFS vs instance store
The three EC2 storage options side by side.
Storage comparison
Every AWS storage option, and which to pick.
Exam tips
- "Disk for one EC2 instance", "boot volume", "database on EC2" → EBS.
- "Shared file system for many Linux instances across AZs" → EFS.
- "Shared file system for Windows", "SMB", "Active Directory" → FSx for Windows File Server.
- "HPC", "parallel file system", "process data from S3 at high speed" → FSx for Lustre.
- "Highest IOPS, temporary data, cache" → instance store.
- "Store unlimited files, accessed over HTTP, cheaply" → S3 (object storage).
AWS documentation
AWS Compute Optimizer
Right-sizing recommendations for EC2, Auto Scaling, EBS, Lambda, Fargate and databases, based on how the resources are really used.
EBS volumes
Amazon EBS volumes are network disks for EC2 instances. They live in one AZ, are billed for their provisioned size, and can be resized live.