What EFS Is
Think of EFS as a serverless, infinitely elastic USB drive that every Linux server in your account can plug into at the same time. You never format it, never partition it, and never worry about running out of space. You just mount it and use it like any other directory.
EFS implements the NFSv4 (Network File System version 4) protocol — the Linux standard for network-attached storage since the 1980s, now modernized. Because it speaks NFS, any Linux application that reads and writes files works with EFS without modification. Windows cannot mount EFS natively because Windows speaks a different protocol (SMB), covered in the next section.
How EFS Works
When you create an EFS file system, AWS provisions Mount Targets — one per Availability Zone in your VPC. Each mount target gets a private IP address. Your EC2 instances connect to the nearest mount target over the network using the NFS protocol. From the application's perspective, it is just a directory. In practice, mounting it is a matter of installing the amazon-efs-utils mount helper and then running a single mount -t efs command against the file system ID — after which the mount behaves exactly like any local directory.
Key characteristics:
- Elasticity: Storage capacity adjusts automatically. You never provision a size. Create a 1 GB file and EFS grows by 1 GB. Delete it and EFS shrinks. You pay only for what you store (~$0.30/GB-month for Standard).
- Concurrent access: Thousands of EC2 instances, Lambda functions, and ECS/EKS containers can mount the same EFS simultaneously.
- POSIX compliance: Full support for file permissions, ownership (
chown,chmod), and file locking (flock). - Performance modes: General Purpose (default, lowest latency) and Max I/O (higher throughput, slightly higher latency — for 10,000+ concurrent clients).
- Throughput modes: Bursting (throughput scales with storage size, like EBS burst credits) and Provisioned (you specify throughput independently of storage size — useful when you have a small dataset but need high throughput).
Storage Classes and Lifecycle
Like S3, EFS has tiered storage classes:
| Class | Use | Cost |
|---|---|---|
| EFS Standard | Frequently accessed files | ~$0.30/GB-month |
| EFS Standard-IA | Infrequently accessed | ~$0.025/GB-month |
| EFS One Zone | Single-AZ, lower durability | ~$0.16/GB-month |
| EFS One Zone-IA | Single-AZ + infrequent access | ~$0.01/GB-month |
You configure Lifecycle Policies to automatically move files to IA after 7, 14, 30, 60, or 90 days of no access. Files are transparently moved back to Standard on next access.
Common Use Cases
- Web server content farms: 50 WordPress servers all reading the same
/var/www/html/wp-content/uploadsdirectory. - Shared home directories: Linux users SSH into different servers but always see the same home directory.
- Container storage: ECS tasks and EKS pods across multiple nodes sharing the same persistent volume.
- CI/CD build caches: Build agents sharing a common dependency cache to speed up pipelines.
Interviewers frequently ask: "Can you mount EFS on Windows?" The answer is no, not natively. EFS uses NFSv4, and Windows does not include an NFS client by default (though Windows Server has an optional NFS client feature, it is not the intended use case and lacks AD integration). For Windows, the answer is always FSx for Windows File Server. A follow-up question is often: "What's the difference between EFS General Purpose and Max I/O performance modes?" — General Purpose has lower per-operation latency and suits most workloads; Max I/O sacrifices some latency for higher aggregate throughput when you have tens of thousands of concurrent clients.
Key Point — Architectural Implication: EFS is Regional, not AZ-local. Data is stored redundantly across multiple AZs within a region (for Standard class). This means an AZ failure does not take down your shared storage. However, cross-AZ NFS traffic incurs data transfer costs (~$0.01/GB). For cost-sensitive workloads with a single AZ, EFS One Zone cuts storage cost by ~47% at the expense of AZ-level durability.