EBS Volume
EBS (Elastic Block Store) is network-attached, persistent block storage for EC2 instances that behaves like a physical hard drive but survives instance stop and restart. Each volume is locked to a single Availability Zone and attaches to one EC2 instance at a time. Production workloads should default to gp3, which decouples IOPS and throughput from provisioned size, unlike the legacy gp2 type.
Zerodha's trading engine runs on io2 Block Express volumes for its order database, where consistent sub-millisecond IOPS matter more than raw storage cost.
Six Volume Types
- gp3 — default SSD choice, 3,000 IOPS baseline, IOPS independent of size
- gp2 — legacy SSD, IOPS tied to size (3 IOPS/GB), avoid for new volumes
- io1/io2 — provisioned IOPS SSD for production databases needing guaranteed performance
- st1/sc1 — HDD types for throughput-heavy or cold archival data, cannot boot
Snapshots
Snapshots are incremental (only changed blocks are stored) and stored in S3 behind the scenes, letting you restore a volume to any AZ in the same region.
TipEnable EBS Recycle Bin with a 7-day retention window so accidentally deleted snapshots can be recovered instead of being gone forever.
Frequently Asked Questions
Why can't you just attach an EBS volume to any EC2 instance you want?
Every EBS volume is created within a single Availability Zone and can only attach to EC2 instances running in that same AZ — it's implemented as network-attached storage over AWS's internal network, not physically local disk, which is exactly why it can survive an instance stop/start (the underlying data isn't tied to instance hardware) but can't span AZs. Moving a volume to another AZ requires snapshotting it and restoring the snapshot as a new volume there.
Why does AWS recommend gp3 over gp2 for most new workloads?
gp2 ties IOPS to volume size (3 IOPS per GB with a burst credit system), so getting more performance meant provisioning a larger volume than you actually needed just to buy IOPS. gp3 decouples IOPS and throughput from size — a baseline 3,000 IOPS and 125 MB/s regardless of size, with more of either provisionable independently at a lower cost per GB. Leaving old volumes on gp2 out of inertia is common; migrating to gp3 is usually a no-downtime win.