Technology and services · 13 min
Block and file storage on AWS
In this lesson you will learn how block, file and object storage differ, and when Amazon EBS, the instance store, Amazon EFS or Amazon FSx is used.
Storage is the place where a computer keeps what it needs to hold on to: its programs, its data and its files. On AWS, an EC2 instance needs that place for its operating system, for its data and for the files it shares with other instances, and AWS has a different service for each case. For example, an online store keeps its website's program in one place, the photos of its products in another and its customers' orders in another.
What types of storage are there on AWS?
AWS offers three types of storage, and each one is used in a different way:
- Block storage, which works like a computer's hard drive: a single instance uses it, and that is where its operating system and its programs go. For example, the store keeps the operating system of the instance that shows its website on a disk of this type.
- File storage, which works like an office's shared folder, which several instances open, read and change at the same time. For example, the five instances that serve the store's website read the same templates from a shared folder.
- Object storage, where you upload a complete file together with its metadata and then request it by its name through an API, without attaching it to any instance as a disk. For example, the store's app requests a shoe's photo by its name and gets it back complete.

Block storage and file storage attach to an instance, which uses them as if they were part of it. Object storage, which on AWS is Amazon S3, is used from anywhere through its API. For example, the store's instance opens its disk the way any computer opens its own, while a customer's phone downloads a product photo directly from S3.
What type of storage is it?
0 of 5Tap the correct column for each case.
The disk where an instance's operating system goes
A folder that ten instances read and write at the same time
Photos that an app requests by their name through an API
The disk of a database on EC2
Complete backups that you upload and later request by their name
Amazon EBS
Amazon EBS (Elastic Block Store) is the block storage for EC2 instances, that is, their hard drives. With EBS you create a volume, which is a virtual disk, and attach it to an instance, which sees it as if it were its own disk. The volume exists separately from the instance, so its data is still there when you turn off the instance. For example, if the store turns off its instance at night, the next morning the orders saved on its EBS volume are still complete.
EBS volumes come in two families, which you choose based on how the data is read and written:
- SSD volumes, which are for workloads with many small, fast operations, such as a database. For example, the store's database saves and looks up a new order every few seconds.
- HDD volumes, which are for reading and writing a lot of information straight through, from beginning to end. For example, once a day the store goes through a huge log with all the visits to its website.
Availability Zones and snapshots
An EBS volume and the instance it is attached to have to be in the same Availability Zone. Within that zone, AWS keeps several copies of each volume so you don't lose the data if a piece of equipment fails. However, those copies stay in the same zone, so they don't protect you if the whole zone fails. For example, if a fire takes down the zone where the store's volume is, all those copies go out of service at the same time.
To protect yourself from that failure, back up the volume with a snapshot, which is a copy of the volume as it was at a point in time. From a snapshot you can create new volumes in another zone or in another Region, and that is also how you bring the data from a volume to an instance that is in another zone. For example, the store takes a snapshot every night and, if its zone fails, uses it to create a new volume in another zone and keeps selling.
True or false?
0 of 4You can attach an EBS volume in one zone to an instance that is in another zone.
If you stop the instance, the data on the EBS volume is still there.
EBS replication within its zone protects the volume if the whole zone fails.
With a snapshot you can create a new volume in another Region.
The instance store
Besides EBS, an instance can have another kind of block storage, the instance store. The instance store is made up of disks that come inside the physical server where the instance runs, so it is fast and has no extra cost. However, it is temporary: its data is erased as soon as the instance stops running on that server. For example, if the store keeps the day's list of orders there and stops the instance, that list disappears.

The difference between the two lies in what happens to the data when you reboot, stop or terminate the instance. Rebooting is turning it off and back on right away, stopping is turning it off to start it later, and terminating is deleting it for good:
| What you do with the instance | Data on EBS | Data on the instance store |
|---|---|---|
| Reboot it | Kept | Kept |
| Stop it | Kept | Lost |
| Terminate it | Kept or deleted depending on the volume's DeleteOnTermination option | Lost |
That is why the instance store is used for temporary data that you can generate again, such as a cache or a buffer, which is a space where data waits a moment before being processed. A database, on the other hand, goes on EBS, because its data has to be kept even if you stop the instance. For example, the store keeps on the instance store the product photos already prepared to show them quickly, which it can prepare again, and keeps its orders on EBS.
Amazon EFS
Amazon EFS (Elastic File System) is a shared file system, that is, a folder on AWS that several instances use at the same time. Many instances can mount the same EFS file system at once, even if they are in different Availability Zones. For example, the five instances that serve the store's website, spread across three zones, read the same product photos from a single EFS file system.

With EFS you don't choose a size, because the file system grows and shrinks as you add or delete files. Also, EFS uses the NFS protocol, which is the Linux one, and the AWS documentation states that it doesn't work with Windows instances. For example, if the store adds a thousand new photos, the file system grows on its own and nobody has to ask for more space.
EFS file systems are of two types, which differ in how many zones store the data:
- The Regional type, which stores the data in several zones and is the one AWS recommends. For example, if one zone fails, the store's instances in the other zones keep reading the photos.
- The One Zone type, which stores the data in a single zone. For example, a school that keeps test copies there that it can re-create accepts losing them if that zone fails.
Amazon FSx

Amazon FSx is used when your team already works with a well-known file system and wants AWS to manage it, that is, wants AWS to take care of keeping it running. AWS recommends choosing among the four FSx file systems based on the one your team already knows or on what the workload needs:
- Amazon FSx for Windows File Server, which offers shared folders for computers with Windows. For example, an accounting office whose employees use Windows keeps its shared folders there.
- Amazon FSx for NetApp ONTAP, which is for teams that already use NetApp, a brand of storage equipment.
- Amazon FSx for OpenZFS, which is for teams that already use ZFS, another well-known file system.
- Amazon FSx for Lustre, which is for high performance computing and which the exam guide leaves out of scope.
Which service do you use?
Ten Windows servers on EC2 need the same shared folders, and your team wants AWS to manage the file system. What do you use?
How do you recognize each service on the exam?
In exam questions, the words in the question tell you which service they are looking for:
- "Volume", "instance disk" or "persistent" (kept even if you turn off the instance), which point to EBS.
- "Temporary", "cache" or "buffer" on the instance's server, which point to the instance store.
- "Shared across several Linux instances" or "NFS", which point to EFS.
- "Windows" together with shared folders, which points to FSx for Windows File Server.
- "Back up a volume" or "copy it to another Region", which point to EBS snapshots.
For example, if a question says that several Linux instances need to read the same files at the same time, the answer is EFS, even though the other options also store data.
cloud path tip: if you use an account with the new AWS experience, EBS and EFS are included in the free plan. FSx is not available until you turn on the advanced features.
Review question
A company is going to move its Windows file server to AWS, with shared folders used by 200 employees, and wants AWS to manage the file system. Which service does it use?
Next
- Storage, the AWS whitepapers page that summarizes its storage services.
- Practice with cloud path's practice exams.