What is the difference between S3, EBS, and EFS?
Understand AWS storage: S3 object storage, EBS block volumes, and EFS shared file systems, with use cases, scope, and performance trade-offs explained.
Expected Interview Answer
S3 is object storage accessed over HTTP APIs for unstructured data at massive scale, EBS is block storage attached to a single EC2 instance like a virtual hard disk, and EFS is a shared file system that many EC2 instances can mount concurrently over NFS.
S3 stores objects in buckets with virtually unlimited capacity and 11-nines durability, ideal for backups, media, and static assets. EBS provides low-latency block volumes bound to one instance in one Availability Zone, perfect for databases and boot volumes. EFS offers an elastic, POSIX-compliant file system that scales automatically and is shared across many instances and AZs, suited to shared content and lift-and-shift workloads.
- S3: near-infinite scale, high durability, pay-per-use object storage
- EBS: low-latency block device for a single instance
- EFS: concurrent multi-instance file sharing over NFS
- Right tool per workload avoids over-provisioning cost
- Each integrates natively with EC2 and IAM
AI Mentor Explanation
S3 is like the national cricket archive where every match's footage is filed by a unique catalog reference and fetched on request from anywhere. EBS is the personal kit bag strapped to one player — fast to reach but only theirs during the match. EFS is the shared team dressing room whose lockers every squad member can open at the same time.
Step-by-Step Explanation
Step 1
Classify the data
Unstructured objects (media, backups) suit S3; block-level OS/database data suits EBS; shared files suit EFS.
Step 2
Check access pattern
S3 uses HTTP APIs; EBS mounts as a block device to one instance; EFS mounts via NFS to many instances.
Step 3
Assess scope and scaling
S3 scales automatically and is region-wide; EBS is single-AZ and fixed-size; EFS scales elastically across AZs.
Step 4
Weigh performance vs. sharing
EBS gives lowest latency for one instance; EFS trades some latency for concurrent multi-instance access.
Step 5
Estimate cost
S3 is cheap per GB with tiering; EBS bills provisioned capacity; EFS bills for storage used and can tier to Infrequent Access.
What Interviewer Expects
- Object vs. block vs. file storage distinction
- Single-instance (EBS) vs. shared (EFS) access
- Awareness of durability and scalability of S3
- Correct protocols: HTTP (S3), block (EBS), NFS (EFS)
- Matching each service to appropriate workloads
Common Mistakes
- Calling S3 a file system you can mount like a disk
- Thinking EBS can be shared by many instances by default
- Confusing EFS with EBS multi-attach
- Ignoring AZ scope of EBS volumes
- Assuming all three have the same latency profile
Best Answer (HR Friendly)
“S3 is like an unlimited online drop-box for files you access over the web, EBS is a hard disk attached to one server, and EFS is a shared folder that many servers can use at the same time. You pick based on whether you need objects, a private disk, or shared files.”
Code Example
aws s3 cp ./backup.tar.gz s3://my-app-backups/2026/backup.tar.gz
# Retrieve it later by key from anywhere
aws s3 cp s3://my-app-backups/2026/backup.tar.gz ./restore.tar.gzVOL=$(aws ec2 create-volume \
--availability-zone us-east-1a \
--size 100 --volume-type gp3 \
--query VolumeId --output text)
aws ec2 attach-volume \
--volume-id $VOL \
--instance-id i-0abc123 \
--device /dev/sdf# Run on each EC2 instance that needs the shared file system
sudo mount -t efs -o tls fs-0abc123:/ /mnt/shared
# Now /mnt/shared is readable/writable from every mounted instanceFollow-up Questions
- When would you choose EFS over EBS for a workload?
- What is EBS Multi-Attach and how does it differ from EFS?
- How does S3 achieve 11 nines of durability?
- Why can't you boot an EC2 instance directly from S3?
- How do S3 storage classes affect cost and retrieval time?
MCQ Practice
1. Which service provides object storage accessed over HTTP APIs?
S3 is object storage; objects are stored in buckets and accessed via HTTP-based APIs by key.
2. Which storage can be mounted concurrently by many EC2 instances by default?
EFS is a shared NFS file system that multiple instances across AZs can mount simultaneously.
3. What is a key limitation of a standard EBS volume?
An EBS volume lives in one Availability Zone and is normally attached to a single instance in that AZ.
Flash Cards
S3 storage type? — Object storage in buckets, accessed over HTTP APIs, near-unlimited scale and 11 nines durability.
EBS storage type? — Block storage — a virtual disk attached to one EC2 instance within a single AZ.
EFS storage type? — Elastic, POSIX file system mounted over NFS by many instances across AZs.
Which is best for a database boot volume? — EBS — low-latency block storage for a single instance.