chapter eight

8 Storing Data on Hard Drives: EBS and instance store

 

This chapter covers

  • Attaching persistent storage volumes to EC2 instance
  • Using temporary storage attached to the host system
  • Backing up volumes
  • Testing and tweaking volume performance
  • Differences between persistent (EBS) and temporary volumes (instance store)

Imagine your task is to migrate an enterprise application from being hosted on-premises to AWS. Typically, legacy applications read and write files from a file system. Switching to object storage, as described in the previous chapter, is therefore not always possible or easy. Fortunately, AWS offers good old block-level storage as well, allowing you to migrate your legacy application without the need for expensive modifications.

Block-level storage with a disk file system (FAT32, NTFS, ext3, ext4, XFS, and so on) can be used to store files as you would on a personal computer. A block is a sequence of bytes, and the smallest addressable unit. The OS is the intermediary between the application that needs to access files and the underlying file system and block-level storage. The disk file system manages where (at what block address) your files are stored. You can use block-level storage only in combination with an EC2 instance where the OS is running.

The OS provides access to block-level storage via open, write, and read system calls. The simplified flow of a read request goes like this:

8.1 Elastic Block Store (EBS): Persistent block-level storage attached over the network

8.1.1 Creating an EBS volume and attaching it to your EC2 instance

8.1.2 Using EBS

8.1.3 Tweaking performance

8.1.4 Backing up your data with EBS snapshots

8.2 Instance store: Temporary block-level storage

8.2.1 Using an instance store

8.2.2 Testing performance

8.2.3 Backing up your data

8.3 Summary