Amazon EFS
Scalable, elastic file storage for Linux-based workloads
EFS is like a shared network drive that multiple computers can access simultaneously. Unlike EBS (which is like a hard drive for one computer), EFS lets hundreds or thousands of EC2 instances read and write to the same files at the same time. It's perfect for situations where you need shared storage, like a team of servers all processing files from the same directory, or a content management system where multiple web servers need access to the same uploaded images. EFS automatically grows and shrinks as you add or remove files, so you never run out of space or pay for unused capacity.
EFS is a fully managed NFS (Network File System) that provides shared file storage for Linux-based workloads. It's elastic: storage grows and shrinks with your files. EFS is multi-AZ by default; data is replicated across multiple Availability Zones for high availability. Performance modes: General Purpose (low latency, the default, recommended for every file system) and Max I/O, a previous-generation mode not supported on One Zone or Elastic throughput file systems. Throughput modes: Elastic (the default; scales automatically and bills per GB transferred), Bursting (throughput scales with stored GiB), and Provisioned (a fixed amount independent of size).
Key Capabilities
- Provides a shared NFS file system mountable simultaneously by thousands of EC2 instances, ECS tasks, Lambda functions, and EKS pods across multiple AZs
- Scales elastically from zero to petabytes without provisioning, shrinking and growing automatically as files are added or removed
- Performance modes: General Purpose (default) for all workloads; Max I/O is previous-generation and unavailable on One Zone and Elastic throughput file systems
- Throughput modes: Bursting (scales with storage size), Provisioned (fixed throughput), and Elastic (auto-scales independently of storage)
- Infrequent Access and Archive storage classes reduce costs for files not accessed recently (Archive: 90-day minimum), with lifecycle policies to move cold files automatically
- Supports NFSv4.1 and is compatible with Linux-based workloads; not suitable for Windows SMB or OS boot volumes
Gotchas & Constraints
Gotcha #1: EFS is more expensive than EBS per GB; use it only when you need shared access; for single-instance storage, use EBS. Gotcha #2: NFS performance depends on network bandwidth; ensure instances have sufficient network capacity. Constraints: Linux only (no Windows support), regional service (can't span regions), and requires VPC connectivity.
Illustrative scenario; figures are examples, not verified customer results.
A content management system (CMS) runs on 10 EC2 instances behind an Application Load Balancer. Users upload images, videos, and documents, which need to be accessible from all web servers. Previously, they used EBS on one instance and rsync'd files to others, which was slow, error-prone, and didn't scale. They migrate to EFS, mounting the same file system on all 10 instances. When users upload files, they're immediately available to all servers. During traffic spikes, Auto Scaling launches 20 more instances, which automatically mount the EFS file system and serve content; they enable EFS Lifecycle Management to move files not accessed in 30 days to Infrequent Access storage, reducing costs by 60%. For disaster recovery, they use AWS Backup to create daily EFS backups, which can be restored to a new file system in minutes.