Amazon EFS
A fully managed NFS file system service that allows simultaneous access from multiple EC2 instances and Lambda functions
Overview
Amazon Elastic File System (EFS) is a fully managed file storage service compliant with the NFS v4.1 protocol. It can be simultaneously mounted and accessed from multiple EC2 instances, Lambda functions, and ECS tasks, with storage capacity automatically scaling as files are added or removed. No capacity planning or provisioning is required, and it scales automatically up to petabytes. Standard and Infrequent Access (IA) storage classes are available, and enabling EFS Intelligent-Tiering automatically moves files to the optimal class based on access frequency to reduce costs. Data is redundantly stored across multiple Availability Zones within a region, ensuring high availability and durability.
Choosing Between EBS and Designing Shared Storage
Both EFS and EBS can serve as storage for EC2 instances, but they target different use cases. EBS is block storage that is exclusively attached to a single EC2 instance (except for io2 Multi-Attach). It is suited for scenarios requiring high-speed access from a single instance, such as databases and OS root volumes. EFS, on the other hand, is file storage that can be simultaneously mounted by thousands of EC2 instances. It is ideal when concurrent access from multiple instances is needed, such as shared configuration files, web content origins, and machine learning training datasets. EFS pricing follows a usage-based model at approximately $0.36 per GB per month (Standard, Tokyo region), whereas Azure Files Premium charges based on provisioned capacity, which can reduce cost efficiency when actual usage is low. EFS's strength lies in its pay-for-what-you-use billing and automatic cost optimization through Intelligent-Tiering.
Performance Modes and Throughput Design
EFS offers two performance modes selected at file system creation. General Purpose mode minimizes per-operation latency and suits the majority of workloads, including web serving, CMS media files, and development environments. Max I/O mode sacrifices some per-operation latency to achieve higher aggregate throughput, making it better for big data processing and machine learning with heavy parallel access from hundreds or thousands of clients. For throughput, Elastic throughput mode automatically adjusts based on access patterns, eliminating the need to manage burst credits or provision fixed throughput. Provisioned throughput mode lets you specify a guaranteed throughput level independent of storage size, useful when you need consistent performance for a relatively small dataset. For a deeper look at Amazon EFS, specialized books on Amazon are also helpful.
Lifecycle Management and Serverless Integration
Enabling EFS lifecycle management automatically transitions files that haven't been accessed for a configurable period (7, 14, 30, 60, or 90 days) to the Infrequent Access storage class, reducing storage costs by up to 92%. EFS Intelligent-Tiering goes further by automatically moving files back to Standard when they are accessed again, ensuring optimal cost without manual intervention. For serverless architectures, EFS supports direct mounting from Lambda functions and Fargate tasks, providing a shared persistent storage layer that ephemeral compute environments lack on their own. This enables use cases like loading large ML models into Lambda, sharing state across Fargate tasks, or providing a common data layer for event-driven pipelines. Mount targets should be created in each Availability Zone where clients reside to minimize cross-AZ data transfer costs and latency.