AWS - Elastic File Systems (EFS)
Scalable Shared File Storage for Cloud-Native Applications
What is Amazon EFS?
Amazon Elastic File System (EFS) is a serverless, fully elastic Network File System (NFS) that allows you to share data between thousands of AWS resources simultaneously. Unlike EBS, which acts like a local hard drive, EFS acts like a shared network folder that multiple servers can "mount" and use at the same time.
EFS is natively elastic, meaning it automatically grows and shrinks as you add or remove files. There is no need to pre-provision a specific size or manage capacity.
1. Core EFS Concepts
Mount Targets & Security
To access an EFS file system, you create a Mount Target in each Availability Zone of your VPC. Instances connect to the file system using its DNS name. Security is managed through VPC Security Groups (Port 2049) and POSIX permissions.
Regional Availability & Durability
By default, EFS is a Regional service. It automatically replicates your data across multiple Availability Zones (AZs) within a single region, providing high durability and continuous availability even if an entire data center fails.
Storage Classes & Lifecycle Management
EFS uses Lifecycle Management to save costs. It automatically moves files that haven't been accessed in a set period (e.g., 30 days) from the Standard class to the Infrequent Access (IA) or Archive classes, which are significantly cheaper.
2. EFS vs. EBS: Key Differences
Choosing between EFS and EBS depends on whether you need dedicated high-speed access or shared multi-instance access.
| Feature | Amazon EBS (Block) | Amazon EFS (File) |
|---|---|---|
| Storage Type | Block Storage (Local Drive) | File Storage (Network Share) |
| Access | Single instance only* | 1 to 1,000s of instances |
| Scalability | Manual (Resize Volume) | Automatic (Fully Elastic) |
| Availability | Single AZ | Multi-AZ (Regional) |
| Latency | Lowest (Sub-millisecond) | Low (Milliseconds) |
*EBS Multi-Attach is available for specific volume types but is limited to a small number of instances.
3. Common EFS Use Cases
Content Management (CMS)
Ideal for WordPress or Drupal sites where multiple web servers need simultaneous access to the same set of images, plugins, and configuration files.
DevOps & Build Tools
Providing a central repository for source code and build artifacts that can be accessed by various agents in a CI/CD pipeline.
Big Data & Analytics
Storing massive datasets that require high aggregate throughput and must be accessible by parallel processing clusters.
Container Persistence
Using EFS as persistent storage for Docker or Kubernetes (EKS) pods, ensuring data survives even if a container is deleted or moved.
Key Takeaway
Use EBS for high-performance databases and boot volumes where low-latency is critical. Use EFS when you need a shared, scalable, and highly available file system that "just works" without manual capacity management.