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 capacity grows and shrinks automatically as you add or remove files, and you pay only for what you use. EFS is multi-AZ by default; data is replicated across multiple Availability Zones for high availability. Performance modes: General Purpose (low latency for most workloads) and Max I/O (higher latency but scales to thousands of instances). Throughput modes: Bursting (throughput scales with storage size) and Provisioned (specify throughput independent of size).
Key Capabilities
Key configurations: lifecycle management (automatically move infrequently accessed files to EFS Infrequent Access storage class, saving 92%), encryption at rest and in transit.
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.
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.