How Does EC2 Instance Store Differ From Amazon EBS?

Ephemeral instance store storage and Amazon Elastic Block Store (EBS) are the two primary block-level storage options available for Amazon EC2 instances. The core difference lies in their physical architecture and data persistence. An EC2 instance store provides temporary block-level storage physically attached to the host computer, meaning data is lost when the instance is stopped, hibernated, or terminated. In contrast, Amazon EBS provides persistent, network-attached block storage that exists independently of the lifecycle of an EC2 instance, allowing data to remain intact even after the instance is shut down or deleted.

Architecture and Physical Location

EC2 Instance Store

An EC2 instance store consists of one or more storage volumes physically attached to the underlying host server where your virtual machine resides. Because the disks (typically NVMe SSDs or SATA-based SSDs/HDDs on older generations) are situated directly inside the physical server chassis, input/output operations do not travel across a network fabric. Instead, they communicate directly over the local PCIe bus.

Amazon EBS

Amazon EBS volumes live on a separate storage network outside the physical host running your EC2 instance. When an application reads from or writes to an EBS volume, the storage traffic traverses the AWS internal network between the EC2 host and the EBS storage cluster. EBS volumes are automatically replicated within their Availability Zone to prevent data loss from the failure of any single hardware component.

Data Persistence and Lifecycle

When Instance Store Data Persists and Disappears

Instance store volumes are designated as ephemeral because their lifespan is tied strictly to the active run state of the associated EC2 instance.

  • OS Reboot: Data on an instance store volume survives if you reboot the guest operating system (either from inside the OS or via the AWS RebootInstances API call), because the instance stays on the same physical host.
  • Instance Stop or Hibernate: If you stop or hibernate an EBS-backed instance that also has instance store volumes attached, the instance store data is permanently wiped. When started again, the instance is likely provisioned on a new physical host.
  • Instance Termination: Terminating the instance permanently erases all data on its instance store volumes.
  • Hardware Failure: If the underlying physical drive or host server fails, all data on the instance store is lost.

When Amazon EBS Data Persists

Amazon EBS volumes behave like external hard drives connected over a network.

  • Stop, Start, and Reboot: Stopping or rebooting an EC2 instance has no effect on the data stored on attached EBS volumes.
  • Instance Termination: By default, the root EBS volume is configured to be deleted when the instance terminates (controlled by the DeleteOnTermination attribute), while any additional attached EBS volumes are detached and preserved by default. Both behaviors can be customized at launch or during runtime.
  • Detachment and Reattachment: You can detach an EBS volume from one EC2 instance and attach it to a different instance within the same Availability Zone, making it straightforward to migrate workloads or recover from instance failures.

Performance Characteristics

IOPS and Latency

Because instance store volumes bypass the network layer entirely, they deliver the lowest possible latency and highest random IOPS available on EC2. Modern NVMe-based instance store volumes (found on storage-optimized instances such as the i3, i3en, and i4i families) can deliver millions of IOPS with sub-millisecond latency.

Amazon EBS performance is governed by the volume type selected (gp3, gp2, io2 Block Express, st1, or sc1) as well as the network bandwidth allocated to the EC2 instance type (EBS-optimized bandwidth). While io2 Block Express volumes can achieve up to \(256,000\text{ IOPS}\) and \(4,000\text{ MB/s}\) of throughput per volume, they still incur a slight network round-trip latency overhead compared to local NVMe drives.

Throughput Calculation

For both storage types, total throughput follows the fundamental relationship between input/output operations per second and block size:

\[\text{Throughput (MB/s)} = \frac{\text{IOPS} \times \text{I/O Size (KB)}}{1024}\]

However, on Amazon EBS, this theoretical throughput is capped by both the volume's provisioned throughput limit and the EC2 instance's maximum EBS bandwidth limit. On an instance store, throughput is constrained only by the physical limits of the local NVMe controller and drive media.

Backup, Snapshots, and Features

Snapshots and Cloning

Amazon EBS natively integrates with Amazon Data Lifecycle Manager and AWS Backup. You can create point-in-time snapshots of an EBS volume, which are incrementally backed up to Amazon S3. These snapshots can be used to restore volumes in any Availability Zone or copied across AWS Regions for disaster recovery.

Instance store volumes do not support native AWS snapshots. If you need to back up data residing on an instance store volume, you must manually copy the files to durable storage (such as Amazon S3, Amazon EFS, or an attached EBS volume) using operating system tools like rsync or AWS CLI commands.

Elastic Volumes and Resizing

Amazon EBS supports Elastic Volumes, allowing you to dynamically increase volume size, adjust IOPS, or change the volume type (for example, migrating from gp2 to gp3) in place without detaching the volume or restarting the instance.

Instance store capacity is fixed and determined exclusively by the EC2 instance type and size you launch. Certain instance families do not include instance store volumes at all (such as t3 or m5), while variants denoted with a d suffix (such as m5d, c5d, or r5d) include fixed-size local NVMe SSDs. To increase instance store capacity, you must change the instance size or family.

Encryption

Amazon EBS offers built-in encryption at rest and in transit using AWS Key Management Service (KMS) keys, which can be enforced across an entire AWS region with a single account-level setting.

On modern Nitro-based EC2 instances, NVMe instance store volumes are automatically encrypted at rest using a hardware-based XTS-AES-256 block cipher module implemented on the Nitro card. The encryption keys are generated automatically per volume and destroyed when the instance stops or terminates; however, you cannot manage or rotate these keys using AWS KMS.

Cost Structure

  • Instance Store: There is no separate per-gigabyte or per-IOPS charge for instance store volumes. The cost of the physical drives is bundled directly into the hourly or per-second compute price of the EC2 instance type.
  • Amazon EBS: You pay separately from the EC2 instance compute cost. EBS pricing is based on the provisioned gigabytes per month, and depending on the volume type (such as gp3 above baseline or io2), you also pay for provisioned IOPS and provisioned throughput, plus per-gigabyte charges for any snapshots stored in S3.

Summary Comparison

Feature EC2 Instance Store Amazon EBS
Attachment Type Physically attached to the host server Network-attached over AWS fabric
Data Persistence Ephemeral (lost on stop, hibernate, or terminate) Persistent (independent of instance lifecycle)
Max Performance Extremely high IOPS, lowest latency (local PCIe/NVMe) High IOPS, low latency (subject to network & volume caps)
Capacity Scaling Fixed per instance type and size Independently scalable up to \(64\text{ TiB}\) per volume
Native Snapshots Not supported Supported (backed by Amazon S3)
Detach / Reattach Tied permanently to a single running instance Can be moved between instances in the same AZ
Pricing Model Included in the EC2 instance hourly rate Billed separately per provisioned GB, IOPS, and throughput

Ideal Use Cases

When to Use EC2 Instance Store

  1. Scratch Data and Caches: Temporary storage for buffers, caches, staging areas, and swap files that can be regenerated easily if an instance fails.
  2. Distributed Replicated Databases: NoSQL databases (such as Apache Cassandra, Aerospike, or Elasticsearch) and distributed file systems (like HDFS) that handle data replication and fault tolerance at the application layer across multiple nodes.
  3. High-Performance Computing (HPC) and Analytics: Workloads requiring extreme disk I/O throughput and minimal latency for intermediate data processing where final results are written out to Amazon S3 or EBS.
  4. Load-Balanced Web Servers: Stateless fleets where configuration and static assets are pulled from version control or S3 at boot time.

When to Use Amazon EBS

  1. Relational and Transactional Databases: Systems like PostgreSQL, MySQL, Oracle, and Microsoft SQL Server that rely on single-node storage durability or storage-level snapshots.
  2. Root/Boot Volumes: Operating system drives that must preserve configuration changes, patches, and logs across instance stops and starts.
  3. Enterprise Applications: Workloads requiring strict compliance controls, KMS-managed encryption keys, point-in-time backup schedules, and independent storage scaling without paying for larger compute instances.