Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
EC2 — Virtual Servers  ›  Lesson

EBS Volumes and Instance Store

Storage / Volumes 12 minEC2 instances store data either on EBS volumes, network drives that persist independently of the instance, or on instance store disks that are fast but lose their data when the instance stops.

EBS Volumes and Instance Store

Inkwell stops its server overnight to save money. In the morning the order database is fine, but a folder of processed images has vanished. Nothing crashed. The two folders simply lived on two different kinds of disk, and only one of them is meant to outlast a stop.

The rule

EBS survives a stop; instance store does not.

An EC2 instance can use two kinds of block storage.

Amazon EBS (Elastic Block Store) volumes are network-attached drives. Each volume is its own resource with its own lifetime:

  • Data survives stopping and starting the instance.
  • A volume can be detached and attached to another instance in the same Availability Zone.
  • Snapshots are point-in-time copies, stored durably by AWS and incremental after the first. From a snapshot you can build a new volume, even in another zone or Region.
  • Types include gp3 (general-purpose SSD, the usual default), io2 (provisioned-IOPS SSD for demanding databases), and st1 and sc1 (cheaper hard-disk types for large sequential data).
  • The root volume is deleted when the instance is terminated, by default. Extra volumes you attach are kept by default. Both are settings you can change.

Instance store is disk physically attached to the host machine. It is very fast and included in the price of the instance types that offer it, but it is ephemeral: data survives a reboot, and is lost when the instance stops, hibernates or terminates, or if the underlying disk fails.

The shortcut

Ask "Would I be upset if this vanished at the next stop?" Yes → EBS, with snapshots. No, it is scratch data I can rebuild → instance store is fine and fast.

Sorting Inkwell's dataStep 1 of 3
  1. The order database

    Losing it would be a disaster. EBS gp3 volume, with a daily snapshot.

Two traps. First, a reboot does not wipe instance store, so a quick test can fool you into trusting it; a stop will. Second, an EBS volume is tied to its zone, so you cannot attach a volume in ap-south-1a to a server in ap-south-1b.

Drills

Answer fast — trust the rule.

quick drill

Inkwell stops and starts its server. What happens to data on its EBS volume?

quick drill

Which event does instance store data survive?

quick drill

A volume sits in ap-south-1a. Can it be attached directly to a server in ap-south-1b?

quick drill

By default, what happens to an instance's root EBS volume when the instance is terminated?

Remember

  • EBS survives a stop; instance store does not.
  • Would I be upset if it vanished? Then EBS with snapshots.
  • Traps: reboots do not prove instance store is safe, and EBS volumes are tied to one AZ.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWhere should this data live?

Inkwell's server keeps two kinds of data on disk: the order database, and a temporary folder of half-resized images that can be regenerated at any time. Explain which should live on an EBS volume and which could live on instance store, what happens to each when the server is stopped, and how Inkwell should back up the database volume.