What is EC2 instance store and how is it different from EBS?
Instance store is disk physically attached to the host computer, giving very fast but temporary storage. Its data is lost when the instance stops, terminates or the hardware fails. EBS is network-attached and persists independently of the instance.
Explain it simply
Instance store is the desk surface in an exam hall: you can write on it and it is right in front of you, but everything is wiped when the exam ends. EBS is your notebook, which you take home and use again tomorrow.
Example
Instance store EBS
Location : physical host disk network-attached
Speed : very high IOPS, low latency good, depends on type
Persistence : lost on stop, terminate, survives stop and terminate
or host failure (if not deleted on terminate)
Survives reboot: yes yes
Snapshots : no yes
Resize : fixed with instance type yes, can modify
Use for : cache, buffers, scratch boot disk, databases, durable dataInstance store comes with certain instance types (for example families with a d suffix, or storage-optimised types). It is included in the instance price.
A good use is temporary data that can be rebuilt, such as a cache, shuffle files in a big-data job, or a replica of data held safely elsewhere. Anything you cannot afford to lose belongs on EBS, S3 or a database.
What to say in the interview
"Instance store is fast local disk that is ephemeral: stop, terminate or a host failure erases it, though a reboot does not. EBS persists and supports snapshots. I use instance store for caches and scratch data, and EBS for anything that must last."
Common mistakes
- Keeping the only copy of a database on instance store.