Skip to content
Pablo Rodriguez

Adding Storage

EC2 instances have four main storage options:

AWS EC2 Storage ResourceRoot VolumeData volumes for single instanceData volumes for multiple Linux instancesData volumes for multiple Windows instances
Amazon EBS (SSD-backed only)YesYesNoNo
Instance storeYesYesNoNo
Amazon EFS [Linux]NoNoYesNo
Amazon FSx for Windows File ServerNoNoNoYes

Important An EC2 instance will always have a root volume, and can optionally have one or more data volumes.

Instance store provides non-persistent storage to an instance:

  • Temporary block-level storage
  • Uses HDD or SSD (including NVMe SSDs for higher I/O performance)
  • Instance store data is lost when the instance is stopped or terminated
  • Data persists when instance is rebooted
  • Dedicated to a particular instance
  • Buffers
  • Cache
  • Scratch data

Amazon EBS volumes provide network-attached persistent storage to an EC2 instance:

  • Persistent block-level storage
  • Can attach to any instance in the same Availability Zone
  • Uses HDD or SSD
  • Can be encrypted
  • Supports snapshots that are persisted to S3
  • Data persists independently from the life of the instance
  • Stand-alone database
  • General application data storage

Amazon EBS SSD-backed volumes are suited for use cases where the performance focus is on IOPS:

General Purpose SSD (gp2):

  • Balances price and performance for a wide variety of workloads
  • Recommended for most workloads
  • Can be a boot volume

Provisioned IOPS SSD (io1):

  • Highest-performance SSD volume
  • Good for mission-critical, low-latency, or high-throughput workloads
  • Critical business applications that require sustained IOPS performance
  • Large database workloads
  • Transactional workloads
  • Can be a boot volume

Certain EC2 instance types can be EBS-optimized:

  • Provides a dedicated network connection to attached EBS volumes
  • Increases I/O performance
  • Additional performance achieved if using an Amazon EC2 Nitro System-based instance type
  • For EBS-optimized instance types, optimization is enabled by default
  • For other instance types that support it, optimization must be manually enabled

Performance EBS-optimized instances provide dedicated bandwidth to Amazon EBS, with options between 425 Mbps and 14,000 Mbps.

Amazon EBS

Limitation: Attaches only to one instance

Not suitable for multiple instances needing shared storage

Amazon S3

Option but not ideal: Object store system, not a block store

Changes overwrite entire files, not blocks of characters

Amazon EFS (Linux)

Best option for Linux: Satisfies the requirement for multiple Linux instances

Provides performance and read/write consistency of a network file system

Amazon FSx for Windows

Best option for Windows: Satisfies the requirement for multiple Windows instances

Native Windows file system compatibility

Amazon EFS provides file system storage for Linux-based workloads:

  • Fully managed elastic file system
  • Scales automatically up or down as files are added and removed
  • Petabytes of capacity
  • Supports Network File System (NFS) protocols
  • Mounts the file system to the EC2 instance
  • Compatible with all Linux-based AMIs for Amazon EC2
  • Home directories: Storage for organizations with many users accessing common datasets
  • File system for enterprise applications: Scalable, elastic, available, and durable file store
  • Application testing and development: Common storage repository for secure, organized code sharing
  • Database backups: Can be mounted with NFSv4 from database servers
  • Web serving and content management: Durable, high-throughput file system for content management
  • Big data analytics: Scale and performance for big data applications
  • Media workflows: Strong data consistency, high throughput, and shared-file access

Use Case: Data actively accessed requiring highest durability and availability

  • Can create mount target in each Availability Zone in the AWS Region
  • Multiple EC2 instances can access from multiple Availability Zones
  • Higher cost but maximum resilience

Amazon FSx for Windows File Server provides fully managed shared file system storage for Microsoft Windows EC2 instances:

  • Native Microsoft Windows compatibility
  • New Technology File System (NTFS)
  • Uses Native Server Message Block (SMB) protocol version 2.0 to 3.1.1
  • Distributed File System (DFS) Namespaces and DFS Replication
  • Integrates with Microsoft Active Directory and supports Windows access control lists (ACLs)
  • Backed by high-performance SSD storage
  • Home directories: File system access for hundreds of thousands of users with file/folder permissions
  • Lift-and-shift application workloads: Fully managed native Windows file shares with Active Directory integration
  • Media and entertainment workflows: High throughput and low latencies for Windows workloads
  • Data analytics: Scalable file systems for data-intensive analytics workloads
  • Web serving and content management: File system accessible across thousands of instances simultaneously
  • Software development environments: Shared file storage for in-cloud development workflows

Storage options for EC2 instances include instance store, Amazon EBS, Amazon EFS, and Amazon FSx for Windows File Server. For a root volume, use instance store or SSD-backed Amazon EBS. For a data volume serving only one instance, use instance store or Amazon EBS storage. For data volumes serving multiple Linux instances, use Amazon EFS, and for multiple Microsoft Windows instances, use Amazon FSx for Windows File Server.