Amazon EFS
EFS (Elastic File System) is a fully managed NFS file system that multiple EC2 instances or Fargate tasks can mount simultaneously across different Availability Zones, with all changes visible to every mounted client immediately. It scales storage automatically with no capacity to provision, replicates data across multiple AZs by default, and is the only shared storage option ECS Fargate tasks can attach to, since EBS cannot mount to Fargate.
A food-delivery backend running on 3 EC2 instances behind a load balancer uses EFS so a file uploaded via Instance 1 is instantly visible when the load balancer routes the next request to Instance 2 or 3.
Performance and Throughput Modes
- General Purpose — lowest latency, the right default for almost everything
- Max I/O — higher aggregate throughput, use only past the 35,000 IOPS ceiling
- Elastic throughput — recommended for all new file systems; scales automatically, costs nothing idle
Storage Tiering
A lifecycle policy can move files untouched for 30 days into EFS Infrequent Access automatically, cutting per-GB cost by up to 92% for cold data.
RememberEFS uses NFS on port 2049 — the most common cause of a failed mount is a missing Security Group rule allowing that port between the EC2 and EFS mount target.
Frequently Asked Questions
Why does EFS matter specifically for Fargate, and not just EC2?
EBS volumes attach to a single EC2 instance at a time, which doesn't work for Fargate since there's no instance to manage and tasks can be scheduled anywhere. EFS is a network file system reachable over NFS from any Fargate task in the VPC, making it the only way to give Fargate containers a persistent, shared filesystem — useful for shared config, uploaded files, or multi-writer workloads.
What's a common performance pitfall with EFS?
Assuming EFS behaves like local disk — in Bursting Throughput mode, throughput scales with the amount of data stored, so a small EFS filesystem can throttle heavily under sustained I/O. Latency per operation is also higher than EBS or local SSD because every read/write is a network round-trip. For latency-sensitive, single-writer workloads, EBS is usually the better fit; EFS is for shared access, not raw speed.