Course contentsShow
← Cloud and Infrastructure
Lesson 121 of 2,9893. Storage PrimitivesFree lesson

Ephemeral vs Persistent Volumes in Cloud

Learn the difference between instance-attached temporary storage and persistent volumes that survive instance termination.

Ephemeral vs Persistent Volumes in Cloud

What You'll Learn

You'll understand the critical difference between temporary storage that vanishes when a VM stops and persistent storage that preserves your data across instance lifecycles.

The Core Concept

When you launch a virtual machine in the cloud, you have two fundamentally different storage options:

Ephemeral volumes (also called instance storage or local storage) are physically attached to the host machine running your VM. Think of them like RAM on your laptop—fast and directly connected, but everything disappears when you shut down. If your VM stops, fails, or gets terminated, all data on ephemeral storage is permanently lost.

Persistent volumes (block storage like AWS EBS, Azure Managed Disks, or GCP Persistent Disks) exist independently from your VM. They're like external USB drives you can plug into different computers. When you stop or terminate your VM, the persistent volume survives intact with all your data. You can even detach it and reattach to a different instance.

When to Use Each

Use ephemeral storage for:

  • Temporary cache files
  • Application logs you don't need long-term
  • Data you can easily regenerate
  • Scenarios requiring maximum I/O performance

Use persistent volumes for:

  • Operating system root disks
  • Databases and critical application data
  • Files that must survive VM restarts
  • Any data you cannot afford to lose

Real-World Analogy

Ephemeral storage is like a hotel whiteboard—perfect for temporary notes during your stay, but erased the moment you check out. Persistent storage is your personal notebook—it goes with you wherever you go and keeps everything you've written.

Key Takeaway: Ephemeral volumes disappear with your VM; persistent volumes survive independently—choose based on whether your data needs to outlive the instance.