Chapter 9. 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 possible. 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 wants 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:
1. An application wants to read the file /path/to/file.txt and makes a read system call.