Elastic File System (EFS)

Learn about Elastic File System, its types and other related concepts.

Amazon EFS is a file storage service. It provides the infrastructure for file storage, sparing users from developing and managing their file systems. It uses the Network File System (NFS) protocol for communication with other resources. EFS allows parallel access to the resources. EC2 instances, ECS instances, and Lambda functions can all access an EFS volume concurrently and simultaneously.

Press + to interact

How EFS works

EFS volumes are created inside a VPC and connect with compute instances using mount targets. A mount target provides an IP address for the NFS endpoint that can be used to mount to an EFS volume. To connect EFS volume to compute instances across multiple AZs, we'd need a mount target in each AZ.

EFS allows multiple services to connect to the file system simultaneously. Thus, it allows simultaneous reading and writing to multiple resources. To ensure data consistency across all the resources, EFS implements a file-locking mechanism.

Note: EFS can be mounted only to Linux-based EC2 instances.

Elastic file systems have two performance modes:

  • General purpose: Used for almost 99% of the use cases.

  • Max I/O: Ideal for workloads with parallel I/O operations.

It also offers two types of throughput modes:

  • Bursting: This mode is similar to gp2 EBS volumes, where throughput depends on the volume of the EFS. Generally, bursting mode is preferred unless we have specific requirements.

  • Provisioned: In this mode, we can specify the required throughput irrespective of the volume of EFS.

EFS file system types

EFS offers two main types of file systems:

  • Regional file system: Regional file systems are deployed in multiple AZs across a region. Since they redundantly backup files in multiple AZs, they are highly available. It requires a mount target in each availability zone to allow the connection of resources. However, multiple subnets in a single AZ can connect through the same mount target. The illustration given below depicts this concept.

Press + to interact
Regional file system
Regional file system
  • One zone file system: One zone file systems are located in a single zone and can only have one mount target in the zone. Resources in other AZs can connect to the file system through the single mount zone, but it incurs additional charges. The illustration below shows one such example where an instance in us-east-1b connects to the EFS through the mount target in us-east-1a.

Press + to interact
One zone file system
One zone file system

One-zone file systems are highly available in the AZ and ideal for use cases where high availability across multiple AZs is not required. They offer lower latency and reduced costs compared to multi-AZ file systems.

EFS storage classes

EFS offers three types of storage classes tailored to the user’s requirements:

  • EFS standard: EFS standard has a sub-millisecond latency and is ideal for frequent read-and-write operations

  • EFS infrequent access (IA): EFS infrequent access is used for data accessed once a quarter of a year.

  • EFS archive: The EFS archive is used for data accessed once a year.

Press + to interact
EFS storage classes
EFS storage classes

Life cycle policies

EFS life cycle policies determine when to move a file into or out of EFS infrequent access (IA) or to EFS archive from EFS standard. EFS life cycle policies follow the three thumb rules:

  • Objects in the EFS standard not accessed for more than 30 days are moved to the EFS infrequent access.

  • Objects in the EFS standard that are not accessed for more than 90 days are moved to the EFS Archive.

  • Objects do not move to EFS Standard from EFS infrequent access or EFS archive by default. However, we can define the Transition into Standard policy, which moves the objects in EFS infrequent access or EFS archive back to EFS Standard on first access.

Press + to interact
EFS life cycle policies
EFS life cycle policies

Get hands-on with 1300+ tech skills courses.