EBS is block storage for EC2—low latency, attached to one instance (mostly). S3 is object storage—HTTP API, huge scale, ideal for files accessed by many clients.
Comparison
| Aspect | EBS | S3 |
|---|---|---|
| Model | Block volume (/dev/xvda) | Object key in bucket |
| Access | Attached EC2 instance | HTTP API, SDK, CLI |
| Typical use | OS disk, database files | Backups, media, logs, static sites |
| Snapshot | EBS snapshot → AMI | Versioning, lifecycle to Glacier |
Decision guide
- Database on EC2? → EBS gp3/io volumes
- User uploads and CDN? → S3 + CloudFront
- Shared POSIX file system? → EFS (preview awareness)
Managed databases use PostgreSQL on RDS with dedicated storage—not your app copying SQL files to S3 for live queries.
Copy backup to S3
# Example: archive a local tarball to S3 (not live DB files)
tar czf backup-$(date +%F).tar.gz ./my-app-config/
aws s3 cp backup-*.tar.gz s3://my-unique-learning-bucket-12345/backups/
Important interview questions and answers
- Q: When S3 over EBS?
A: Sharing files across services, internet-scale downloads, cheap durable storage. - Q: When EBS over S3?
A: OS root volume, database needing block-level I/O on EC2.
Self-check
- What storage model does S3 use vs EBS?
- Give one use case for each service.
Tip: Backups archive to S3; live database files stay on EBS or RDS—not manual S3 copy for OLTP.
Interview prep
- When S3?
Shared files, backups, static assets, data lake—HTTP-scale object access.
- When EBS?
EC2 boot volumes and apps needing block-level attached storage.