5.64 EFS and EBS volumes

This section wraps up the EBS and EFS chapter with a side-by-side comparison. EBS provides block storage attached to a single EC2 instance at a time. An EBS volume is tied to one availability zone — it cannot communicate with an EC2 instance in another AZ. The standard gp2 volume type offers IOPS that scale with size, while io1 lets you provision IOPS independently of size but is more expensive.

Moving and sharing storage

  • To migrate an EBS volume across AZs: create a snapshot, copy it to the target AZ via Amazon S3, then restore a new volume from the snapshot.
  • EFS is a managed NFS file system that can be mounted by hundreds or thousands of EC2 instances at the same time, across multiple AZs.
  • Each AZ has an EFS mount target; clients connect through it transparently.
  • EFS is not bound to a single AZ — it is regional by nature.
  • EFS requires Linux POSIX clients (Amazon Linux, Ubuntu, RHEL, etc.) — it does not work on Windows.

Typical EFS use case: hosting a high-availability application like WordPress with three frontend EC2 instances serving the same media library out of a single shared EFS resource. With EBS this would force you to copy the media on each instance, with EFS the data is shared natively. EFS is more expensive per GB than EBS but you can move rarely-accessed files to the cheaper Infrequent Access tier with a lifecycle rule.

To recap: pick EBS when a single EC2 instance owns the data and needs low-latency block access — ideal for databases, application binaries, and OS root volumes. Pick EFS when multiple Linux EC2 instances must share the same file tree, possibly across AZs — ideal for shared content, multi-instance web apps, and data processing pipelines. Both are managed by AWS, both support encryption at rest, and both can be resized — but they serve fundamentally different storage patterns.

Summary

This lesson covers two essential AWS storage services: EBS and EFS volumes. EBS volumes are block storage devices that attach to a single EC2 instance within an availability zone, with options like GP2 for standard workloads and IO1 for higher IOPS requirements; migration between zones is possible via snapshots stored in S3. EFS is a network file system supporting POSIX compliance that can be mounted on multiple instances across different availability zones simultaneously, making it ideal for high-availability architectures like shared WordPress deployments, with cost optimization through tiered storage classes for infrequent access.

Key points

  • EBS volumes are block storage locked to a single availability zone and can attach to only one instance at a time
  • EBS snapshots enable migration across availability zones by storing a snapshot in Amazon S3 and restoring it to the target zone
  • EFS is a network file system that can be mounted on multiple instances across different availability zones simultaneously without AZ locking
  • EFS is designed for POSIX-compliant systems and commonly used in high-availability scenarios such as shared WordPress storage clusters
  • EFS has higher costs than EBS but offers storage classes to reduce expenses for infrequently accessed files through tiered pricing

FAQ

What is the primary difference between EBS and EFS regarding availability zones?

EBS volumes are locked to a single availability zone and can only attach to one instance at a time, whereas EFS can be mounted on multiple instances across multiple availability zones simultaneously, providing greater flexibility for distributed architectures.

How can you move an EBS volume to a different availability zone?

Create a snapshot of the EBS volume, which is stored in Amazon S3, then restore that snapshot in the target availability zone. This process allows you to replicate the volume data across zones.

When should you choose EFS over EBS?

Use EFS when you need shared storage accessible by multiple instances across availability zones for high-availability requirements, such as WordPress with multiple frontend instances. However, EFS only supports POSIX-compliant systems and has higher costs than EBS.