What is the difference between Amazon EFS and Amazon EBS?
EBS is a block disk attached to one EC2 instance in one AZ. EFS is a managed shared file system using NFS that many instances across multiple AZs can mount at the same time.
Explain it simply
EBS is the hard disk inside your own laptop: fast and private to you. EFS is the shared drive in the college computer lab that every machine can open at once, and everyone sees the same files.
Example
EBS EFS
Type : block storage file storage (NFS)
Attach : one instance at a time* thousands of clients at once
Scope : single AZ multiple AZs in a Region
Capacity : you pick the size grows and shrinks automatically
OS : Linux and Windows Linux (NFS)
Typical use : boot disk, database shared content, home folders,
CMS uploads across web servers
* io1/io2 volumes support Multi-Attach in limited casesUse EBS when one server needs fast, low-latency disk. Use EFS when several web servers behind a load balancer must read and write the same files, such as WordPress uploads.
EFS costs more per GB than EBS but you pay only for what is stored. It also has storage classes, for example Infrequent Access, to reduce cost for older files.
What to say in the interview
"EBS is single-instance, single-AZ block storage, like a local disk. EFS is a shared, auto-growing NFS file system across AZs, for several Linux servers needing the same files. I pick EBS for databases and boot volumes, EFS for shared content."
Common mistakes
- Trying to mount EFS on Windows servers.