Amazon EFS

Also known as: Amazon Elastic File System · Elastic File System

On this page 7

Amazon EFS (Amazon Elastic File System) is a fully managed, elastic network file system on Amazon Web Services that exposes a shared POSIX-compliant directory tree over the NFS protocol, so that many servers, containers and functions can read and write the same files at the same time. Within cloud storage, it fills the gap between block volumes attached to one machine and object storage accessed through an HTTP API.

The defining property is elasticity: an EFS file system has no provisioned size. It grows and shrinks automatically as files are added or deleted, and the customer pays for the data actually stored. This makes the Elastic File System a common choice for shared application data, content repositories, home directories and persistent volumes for containers in the Cloud.

How Amazon EFS serves files over NFS

Amazon EFS works by placing mount targets inside a virtual private cloud and letting clients mount the file system with a standard NFSv4.0 or NFSv4.1 client. Each mount target is an elastic network interface with an IP address in one subnet, typically one per Availability Zone, and it accepts traffic on TCP port 2049 subject to security group rules.

Behind the mount targets, AWS stores data and metadata redundantly across multiple Availability Zones for Regional file systems. The service handles locking, consistency and capacity, so clients see ordinary file semantics: directories, permissions, hard and symbolic links, and close-to-open consistency typical of NFS. Applications therefore need no code changes to use EFS, which is its main advantage over object storage.

The following table lists the main building blocks an engineer configures when deploying an EFS file system.

ComponentRoleTypical configuration
Mount targetNetwork entry point in a subnetOne per Availability Zone used
Security groupControls NFS accessAllow port 2049 from client groups
Access pointEnforces a POSIX identity and root directoryOne per application or tenant
EFS mount helperSimplifies mounting with TLSPackage amazon-efs-utils on clients
File system policyIAM-based authorization rulesRequire encryption in transit
Core components of an EFS deployment

Storage classes and throughput modes in EFS

EFS cost and performance are shaped by two independent choices: the storage class where each file lives and the throughput mode of the file system. Lifecycle management moves files that have not been accessed for a chosen number of days into cheaper classes and can move them back on first access.

Storage classIntended dataTrade-off
EFS StandardFrequently accessed filesLowest latency, highest storage price
EFS Infrequent AccessFiles read a few times per quarterLower storage price, per-GB access charge
EFS ArchiveFiles read a few times per yearLowest storage price, higher access cost
One Zone classesReproducible or non-critical dataSingle Availability Zone, lower price
EFS storage classes compared

Throughput determines how fast clients can move data in aggregate. Elastic throughput is the recommended default for spiky or unpredictable workloads because it scales automatically and bills per gigabyte transferred. Provisioned throughput suits steady, high-throughput workloads with a small data footprint, while the older Bursting mode ties baseline throughput to the amount of data stored and relies on accumulated burst credits.

Throughput modeBest fitMain risk
ElasticUnpredictable or spiky accessHigher cost under constant heavy load
ProvisionedSteady throughput, small data setPaying for unused capacity
BurstingLarge data set, modest throughputThrottling when credits run out
Choosing an EFS throughput mode

A separate performance mode setting also exists. General Purpose delivers the lowest per-operation latency and is the right choice for almost all workloads; Max I/O was designed for highly parallel workloads but adds latency and is not supported with Elastic throughput.

Amazon EFS compared with EBS and S3

Amazon EFS is best understood next to its neighbors in AWS cloud storage: Amazon EBS provides block volumes and S3 provides object storage. Each answers a different access pattern, and choosing the wrong one usually shows up as poor performance or unnecessary cost.

PropertyAmazon EFSAmazon EBSAmazon S3
Access modelFile system over NFSBlock deviceObjects over HTTPS API
Concurrent clientsThousandsUsually one instanceEffectively unlimited
CapacityElastic, no provisioningProvisioned volume sizeElastic, no provisioning
ScopeRegional or one zoneSingle Availability ZoneRegional
Typical latencyLow millisecondsSub-millisecondTens of milliseconds
Relative price per GBHighest in StandardMediumLowest
Shared file, block and object storage on AWS

The practical rule is simple: use EBS for a single database or boot volume, S3 for large immutable objects and data lakes, and EFS when several compute nodes need the same files through a normal file interface. Windows workloads that require SMB belong on Amazon FSx rather than EFS, because EFS supports only NFS clients and is intended for Linux.

Security, durability and replication

EFS protects data through encryption at rest with AWS Key Management Service keys, encryption in transit with TLS through the mount helper, and IAM authorization evaluated against file system policies. Access points add an application-level boundary by forcing a specific user ID, group ID and root directory, which prevents one tenant from browsing another tenant’s files.

Regional file systems are designed for eleven nines of durability and remain available if one Availability Zone fails. For disaster recovery, EFS Replication maintains a read-only copy in another Region or zone, and AWS Backup provides scheduled, point-in-time backups. Replication protects against regional outages but not against accidental deletion, because deletions are replicated too, so backups remain necessary.

Limitations and common mistakes with EFS

EFS is convenient, yet it carries the inherent overhead of network file systems. Every metadata operation crosses the network, so workloads with millions of small files or heavy directory listing run noticeably slower than on local disks. The table below summarizes frequent problems seen in production.

SymptomLikely causeFix
Slow builds or package installsMany small-file metadata callsBuild on local disk, copy results
Sudden throughput dropBursting credits exhaustedSwitch to Elastic throughput
Unexpectedly high billData kept in Standard classEnable lifecycle management
Mount hangs or times outPort 2049 blockedFix security group rules
Permission denied errorsMismatched POSIX user IDsUse access points with fixed IDs
Typical EFS problems and their fixes

Another frequent mistake is treating EFS as a database backend. Transactional databases need consistent low latency and strict locking, which a block volume delivers far more reliably. EFS also cannot be mounted directly from outside AWS without a VPN or Direct Connect link.

Explained without jargon

Think of Amazon EFS as a shared network drive in the cloud. Many computers can open the same folder, see the same files and save changes that the others see right away. Nobody has to decide in advance how big the drive should be, because it stretches as files are added and shrinks when they are removed.

The customer pays for what is stored, and old files that nobody opens can be moved automatically to cheaper shelves. The main point is that EFS is for sharing files between machines, not for holding a single computer’s disk or for storing huge numbers of archived objects.

A typical use case

A media company runs its content management system on twelve containers spread across three Availability Zones behind a load balancer. Editors upload images and documents through any container, and every other container must serve those files immediately. The team mounts one Regional EFS file system into all containers through the EFS CSI driver, with an access point that fixes the application user ID.

The library holds about 800 GB, but only recent articles are read often. The team enables lifecycle management to move files untouched for 30 days to Infrequent Access and chooses Elastic throughput to absorb traffic peaks when a story goes viral. As a result, uploads appear on every node at once, an Availability Zone outage no longer takes the site down, and storage cost falls by more than half compared with keeping everything in the Standard class.