Choosing Between Block Storage and File Storage
This lesson explains how block storage behaves like a hard drive for a server and file storage provides shared folders for many servers. Knowing which to use is a common exam question.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish Amazon EBS volumes from EC2 instance store.
- Distinguish Amazon EFS from the Amazon FSx file systems.
- Choose a storage service from who uses the data and how.
Block storage
EC2 instances can use two kinds of block storage, which behave like a computer's hard drive. Amazon EBS provides persistent volumes: data stays on the volume when the instance stops, so EBS is used for operating systems and data that must be kept. A volume exists in one Availability Zone and is usually attached to one instance, and snapshots back it up to S3, from where it can be copied to other Regions.
Instance store is temporary storage on disks physically attached to the server that hosts the instance. It is very fast, but its data is lost when the instance stops or terminates, or if the hardware fails, so it is only for temporary data such as caches and scratch files. The following table summarises the differences.
EBS or instance store?
File storage
File storage lets many servers use the same files at the same time, like a shared network drive. Amazon EFS is a fully managed shared file system for Linux. Many EC2 instances, containers and Lambda functions in several Availability Zones can use it at once, it grows and shrinks automatically, and you pay for what you store.
The Amazon FSx family provides managed versions of other popular file systems. FSx for Windows File Server provides Windows file shares that work with Active Directory. FSx for NetApp ONTAP and FSx for OpenZFS provide managed versions of those platforms, so applications that rely on their features can move to AWS unchanged. The following table summarises the services.
| Service | What it provides |
|---|---|
| Amazon EFS | A fully managed, elastic shared file system (NFS) for Linux; many instances, containers and Lambda functions across AZs share it; you pay for what you use |
| FSx for Windows File Server | Windows SMB shares integrated with Active Directory |
| FSx for NetApp ONTAP, FSx for OpenZFS | Managed file systems for those platforms |
Choosing storage
Choosing storage starts with who uses the data and how. A disk for one server is an EBS volume. Files shared by several Linux servers belong in EFS, and files shared by Windows servers belong in FSx for Windows File Server. Objects, such as images, videos and backups, that are accessed over the internet or by many applications belong in S3. The following table summarises the choice.
| Need | Choose |
|---|---|
| A disk for one server | EBS |
| Shared files for Linux | EFS |
| Shared files for Windows | FSx for Windows File Server |
| Objects accessed over the internet or by many apps | S3 |
Choosing storage
Choosing storage for four needs
A single application has four distinct storage requirements. The following table identifies the appropriate storage service for each and the reason for the choice.
| Need | Choice | Why |
|---|---|---|
| The operating system disk for an EC2 instance | Amazon EBS | Persistent block storage for one instance |
| Temporary scratch space for a calculation, which can be lost | Instance store | Fast and included; data disappears when the instance stops |
| Shared folders used by ten Linux servers | Amazon EFS | Shared file system, grows automatically |
| Windows file shares for the finance team, with Active Directory permissions | Amazon FSx for Windows File Server | Native Windows file sharing |
Every night, an EBS snapshot backs up the instance's disk. If the instance is lost, a new volume created from the snapshot restores the data, even in another Availability Zone or Region.
What is Amazon EBS?
Show answer
Block storage volumes attached to EC2 instances, which keep their data when the instance stops.
Exam Tips
Remember for the exam
- A persistent disk for an EC2 instance is EBS.
- To back up an EBS volume, take an EBS snapshot.
- A shared Linux file system for many instances is EFS.
- Windows file shares integrated with Active Directory call for FSx for Windows File Server.
- Instance store data is lost when the instance stops.
- Shared file storage is EFS for Linux and FSx for Windows File Server for Windows.