Building Shared File Storage with Amazon EFS - Mounting from Lambda, ECS, and EC2 with Design Guidelines
Clarify the criteria for selecting performance modes and throughput modes, and learn how to optimize costs through lifecycle management with automatic tiering to the IA storage class.
EFS Features and When to Choose EFS Over EBS and S3
EFS is an NFS v4.1-compliant managed file system whose key advantage is that multiple compute resources can mount it simultaneously. EBS is block storage attached to a single EC2 instance (except for io2 Multi-Attach), and S3 is object storage that cannot be mounted as a POSIX file system. When multiple instances or containers need to access the same files, EFS is the only option. It is well suited for use cases such as shared media storage for CMS, sharing ML training data, and sharing CI/CD build caches.
Performance Modes and Throughput Modes
There are two performance modes: General Purpose and Max I/O. General Purpose offers lower latency and is suitable for most workloads. Max I/O is optimized for concurrent access from thousands of clients but introduces slightly higher latency. There are three throughput modes: Elastic, Provisioned, and Bursting. Elastic mode automatically scales throughput based on access patterns, providing up to 10 GiB/s of read throughput. Since it eliminates the need to manage burst credits, Elastic mode is recommended for new deployments. Provisioned mode is used when you need guaranteed throughput.
Lifecycle Management and Cost Optimization
EFS lifecycle management automatically transitions files that have not been accessed for a specified period to the Infrequent Access (IA) storage class. IA storage pricing is approximately 8% of the Standard class, enabling up to 92% cost savings. Transition triggers can be set to 1, 7, 14, 30, 60, or 90 days. Accessing files in the IA class incurs a per-read access charge, but for infrequently accessed files, the storage cost savings outweigh this. Enabling Intelligent-Tiering also allows files that are accessed again to be automatically moved back to the Standard class. For a deeper understanding of EFS, specialized books (Amazon) are a helpful resource.
Summary
EFS is the only POSIX-compliant managed service on AWS for file storage that requires shared access from multiple compute resources. Combining Elastic throughput mode with lifecycle management optimizes both performance and cost. Mounting from Lambda and ECS enables shared file systems even in serverless architectures.