EFS vs EBS vs S3: Which AWS Storage Should You Use?

Block, file or object? How Amazon EBS, EFS and S3 differ in access model, performance, durability, sharing and price, with clear rules for picking the right one (and when FSx fits instead).

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

EBSEFSS3
TypeBlock (a disk)File (NFS)Object (HTTP API)
Attached toOne EC2 instance (Multi-Attach only for io1/io2)Thousands of clients across AZs: EC2, ECS, EKS, LambdaAnything that can make HTTPS calls
ScopeOne Availability ZoneRegional (or One Zone)Regional, globally addressable
CapacityYou provision sizeGrows and shrinks automaticallyVirtually unlimited
LatencyLowest (sub-millisecond on SSD)Low millisecondsHigher per request; very high throughput in parallel
You pay forProvisioned GB (+ IOPS/throughput on some types)GB actually stored (+ throughput mode)GB stored, requests, retrievals, transfer
Typical useBoot volumes, databases on EC2Shared content, home directories, container persistent storageMedia, 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

  1. Only one EC2 instance needs it, with low latency (OS, database files)? EBS.
  2. Several servers or containers need to share a POSIX file system? EFS (or FSx for Windows, Lustre, NetApp ONTAP or OpenZFS for specialized needs).
  3. 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.

Browse all AWS tutorials · Hands-on AWS labs