Lesson 2 of 4 Storage Services

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.

Amazon EBS
What it isPersistent block volumes, like a virtual hard drive
PersistenceData persists when the instance stops
ScopeOne AZ; usually attached to one instance
BackupsSnapshots: point-in-time backups in S3, copyable to other Regions
Use forBoot and data volumes; SSD (gp3, io2) and HDD types
Instance store
What it isTemporary block storage physically attached to the host
PersistenceData is lost when the instance stops or terminates, or hardware fails
ScopeOne host
BackupsNone
Use forCaches and scratch files
Sort into groups

EBS or instance store?

Exam skills 3.6.3

Decide which block storage each statement describes.

Log in to try this activity Interactive activities are free with an account.

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.

ServiceWhat it provides
Amazon EFSA 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 ServerWindows SMB shares integrated with Active Directory
FSx for NetApp ONTAP, FSx for OpenZFSManaged 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.

NeedChoose
A disk for one serverEBS
Shared files for LinuxEFS
Shared files for WindowsFSx for Windows File Server
Objects accessed over the internet or by many appsS3
Match the pairs

Choosing storage

Exam skills 3.6.1 · 3.6.3 · 3.6.4

Match each need with the storage service that meets it.

Log in to try this activity Interactive activities are free with an account.
Worked example

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.

NeedChoiceWhy
The operating system disk for an EC2 instanceAmazon EBSPersistent block storage for one instance
Temporary scratch space for a calculation, which can be lostInstance storeFast and included; data disappears when the instance stops
Shared folders used by ten Linux serversAmazon EFSShared file system, grows automatically
Windows file shares for the finance team, with Active Directory permissionsAmazon FSx for Windows File ServerNative 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.

Check yourself

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.