AWS has three core storage services, and they are not interchangeable: Amazon EBS is block storage for one instance, Amazon EFS is a shared file system, and Amazon S3 is object storage reached over an API. Picking the wrong one leads to awkward workarounds, poor performance or a bigger bill than necessary.
The comparison
| EBS | EFS | S3 | |
|---|---|---|---|
| Type | Block (a disk) | File (NFS) | Object (HTTP API) |
| Attached to | One EC2 instance (Multi-Attach only for io1/io2) | Thousands of clients across AZs: EC2, ECS, EKS, Lambda | Anything that can make HTTPS calls |
| Scope | One Availability Zone | Regional (or One Zone) | Regional, globally addressable |
| Capacity | You provision size | Grows and shrinks automatically | Virtually unlimited |
| Latency | Lowest (sub-millisecond on SSD) | Low milliseconds | Higher per request; very high throughput in parallel |
| You pay for | Provisioned GB (+ IOPS/throughput on some types) | GB actually stored (+ throughput mode) | GB stored, requests, retrievals, transfer |
| Typical use | Boot volumes, databases on EC2 | Shared content, home directories, container persistent storage | Media, backups, data lakes, static websites, logs |
EBS: a disk for one server
EBS behaves like a hard drive: you format it with a file system and the operating system reads and writes blocks. It is the right choice when one instance needs fast, low-latency storage, such as a boot volume or a database you run yourself on EC2. It lives in one AZ, so protect it with snapshots. More in EBS Volume Types Explained.
EFS: a shared file system
EFS is a managed NFS file system that many clients mount at the same time, across Availability Zones. Use it when several servers or containers must see the same files: a fleet of web servers sharing uploaded content, CMS media folders, shared home directories, machine learning datasets, or persistent volumes for containers that move between hosts.
- Storage classes (Standard, Infrequent Access, Archive) with lifecycle management lower the cost of rarely read files.
- Throughput modes: Elastic (scales automatically, the usual default), Provisioned or Bursting.
- Mount targets in each AZ's subnet, protected by security groups allowing NFS (TCP 2049).
- Access points enforce a user identity and root directory per application.
EFS is Linux/NFS only. For Windows file shares, use FSx for Windows File Server.
S3: object storage at any scale
S3 stores whole objects (files plus metadata) addressed by bucket and key, and you read and write them over HTTPS rather than mounting a disk. It is the most durable and cheapest option per GB, scales without limits and integrates with almost every AWS service. You cannot edit part of an object in place; you replace it. That makes S3 ideal for write-once, read-many data: images and videos, backups, logs, exports, data lakes queried with Athena, and static websites.
Lower storage classes and lifecycle rules make cold data very cheap; see S3 Storage Classes Explained.
How to choose
- Only one EC2 instance needs it, with low latency (OS, database files)? EBS.
- Several servers or containers need to share a POSIX file system? EFS (or FSx for Windows, Lustre, NetApp ONTAP or OpenZFS for specialized needs).
- Applications store and fetch whole files through code, at large scale, or you need cheap durable archives? S3.
Common mistakes
- Using EFS as a database disk. Network file system latency hurts databases; use EBS or a managed database.
- Copying user uploads to each server's EBS volume. Servers drift apart; use S3 (or EFS) as the shared source of truth.
- Mounting S3 as a file system for heavy random writes. Tools like Mountpoint for S3 are great for reading large objects, not for workloads that rewrite parts of files.
- Forgetting EBS is zonal. An instance in another AZ cannot attach it; restore a snapshot there instead.
Practice it
Build all three in real AWS accounts: Getting Started with S3, Shared POSIX Storage with Amazon EFS Across Two AZs and EBS Operations: gp2 to gp3 and Automated Snapshots.
FAQ
Which is cheapest?
Per GB stored, S3 (especially colder classes), then EBS gp3, then EFS Standard. But price depends on access: EFS charges only for what you store while EBS charges for what you provision.
Can Lambda use EFS?
Yes. Lambda functions in a VPC can mount EFS access points, useful for large libraries or models and for sharing files between invocations.