Amazon EFS のアイコン

Amazon EFS Essential2015年〜

A shared file storage service accessible from multiple EC2 instances simultaneously

What It Does

Amazon EFS (Elastic File System) is a fully managed file storage service that can be read from and written to by multiple EC2 instances simultaneously. It supports the NFS (Network File System) protocol, allowing data access through standard Linux file operations. Capacity automatically scales up and down based on the amount of stored data, eliminating the need for upfront capacity planning.

Use Cases

It is used for storing content shared across multiple servers, managing configuration files and media files shared between web servers, persistent storage in container environments, data sharing for big data analytics, sharing training data for machine learning, and other scenarios where multiple servers need to access the same data.

Everyday Analogy

Think of it like a shared folder on a company network. A shared folder on the internal network is accessible from any computer, and when someone adds a file, everyone else can see it immediately. EFS works the same way - it's shared storage that multiple servers can access simultaneously.

What Is EFS?

Amazon Elastic File System (EFS) is a fully managed shared file storage service from AWS. While EBS is a dedicated disk attached to a single EC2 instance, EFS is a shared disk that can be mounted and used by multiple EC2 instances simultaneously. Storage capacity automatically grows and shrinks as files are added or deleted, eliminating disk capacity management.

Key Features

EFS's standout feature is its elasticity, automatically scaling to petabyte capacity. Storage expands automatically when you save files and shrinks when you delete them. It also delivers consistent performance even when accessed simultaneously by thousands of EC2 instances. Storage classes include Standard for frequently accessed data and Infrequent Access (IA) for less frequently accessed data, with lifecycle management for automatic transitions between them.

Differences from EBS

Both EBS and EFS are storage used with EC2, but they serve different purposes. EBS is block storage exclusively attached to a single EC2 instance, suited for OS disks and database storage. EFS is file storage accessible from multiple instances simultaneously, suited for shared data. EBS requires specifying a size in advance, while EFS automatically adjusts its size. For design patterns and operational practices comparing EBS and EFS, books on Amazon provide detailed coverage.

Getting Started

To get started with EFS, create a file system in the EFS console. Select a VPC and subnets, create mount targets, and you're ready. Mount EFS from an EC2 instance using the mount command, and you can read and write files just like a regular directory. The Amazon EFS mount helper makes the mount configuration even simpler.

Things to Watch Out For

  • EFS costs more per GB than EBS, so EBS is more cost-effective when shared access is not needed
  • EFS cannot be mounted directly from Windows instances. For Windows environments, consider FSx for Windows File Server
  • Using the Infrequent Access storage class can significantly reduce costs for infrequently accessed files
共有するXB!