Amazon Elastic File System

Navigating the Power of Amazon Elastic File System (EFS)

Amazon Elastic File System (Amazon EFS) is a user-friendly, serverless file system that operates on a set-and-forget principle. It requires no intricate setup or minimum fees. 

With Amazon EFS, you only incur charges for the storage space you utilize, as well as for read and write access to data stored in Infrequent Access storage classes, and any allocated throughput. The solution architect is responsible for handling the Amazon Elastic File System.

To prepare for the AWS Certified Solutions Architect – Associate exam (SAA-C03), it’s essential to delve into the specifics of Amazon EFS, including its features, use cases, integration possibilities, and best practices.

In this blog, we will delve into the basics of AWS EFS, AWS EFS features, and AWS EFS use cases, and make comparisons with other storage solutions provided by AWS. Furthermore, you will gain an understanding of how to connect and configure EFS through our guided hands-on labs.

Let’s dive in!

Amazon Elastic File System (EFS): An Overview

AWS Elastic File System (EFS) is one of the major storage solutions of Amazon. This storage type can be scalable, serverless, and cloud-based file systems. It supports Linux-based applications and workloads and works together with the AWS cloud services and on-premise cloud resources.

According to the needs, the EFS has been categorized into two storage classes such as infrequent access and standard access.

In standard access, the storage will be accessed frequently whereas infrequent accessing storage is meant for long-term usage but can be accessed with less frequency at an affordable cost. 

The file systems can be scaled automatically from the storage size ranging from gigabytes to petabytes without the need for storage provisioning. A massive number of computing instances can access the AWS EFS file system at the same time and you can pay only for what you use.

Also Read: Different Storage solutions of AWS

Amazon EFS features

Amazon Elastic File System (EFS) has some unique features as follows:

Fully Managed

AWS EFS refers to a fully managed service that offers NFS-shared file system storage to manage the Linux workloads. It can be built easily and configuration of the file system using the Amazon EFS can be done easier. You need not take care of the file server or storage management, hardware updates, software configuration, or backups. The main benefit of the Amazon EFS such that you can create the fully managed file system within seconds in the AWS Management Console, AWS Command Line Interface (CLI), or an AWS SDK.

Highly available and durable

 Amazon Elastic File System (EFS) has a high durability of 99.999999999% and availability of up to 99.99 %. When you opt for the Standard storage classes,  AWS EFS retains every file system object such as directory, file, and link redundantly across the multiple Availability Zones (AZs). When you choose AWS EFS One Zone storage classes, then the data will be stored redundantly within a single Availability Zone.

This system is designed to handle concurrent device failures by quickly detecting and correcting lost redundancy. Additionally, a file system using Standard storage classes in any AWS Region can be accessed from any Availability Zone (AZ) where it is located.

In simpler terms, you can set up your application to seamlessly switch from one AZ to another within the Region, ensuring maximum availability. Mount targets for all Amazon EFS storage classes are intended to be highly accessible within a specific AZ.

Elastic & Scalable
  • EFS automatically scales your file system’s storage based on the number of documents.
  • It expands when new files are added and contracts when files are deleted.
  • No need for customers to pre-provision storage.
  • EFS can handle a petabyte-scale file system and its throughput scales with its capacity.
Performance Modes

EFS offers two performance modes

  • General purpose: Provides low per-operation latency, accommodating up to 35,000 IOPS.
  • Max I/O: Supports 500,000+ IOPS with higher per-operation latencies.

EFS One Zone storage classes always use General Purpose mode, and you can choose either the default General Purpose or the Max I/O option for EFS Standard storage types.

Throughput Modes

AWS EFS provides two throughput modes:

  • Bursting Throughput (default): Suited for applications with bursty throughput patterns. Saves burst credits during low throughput and utilizes burst buckets during high throughput.
  • Provisioned Throughput: Ideal for applications with a relatively steady throughput. In this mode, you define a level of throughput irrespective of the file system’s size or burst credit balance.
Security

AWS EFS ensures security through measures such as:

  • Network traffic security
  • File and directory access control
  • Data encryption
  • Identity and Access Management (IAM) integration.

When to opt for AWS EFS?

Amazon EFS is applicable in various scenarios:

  1. Shared File Storage: For situations where multiple EC2 instances need to access the same data, Amazon EFS stands out. It adeptly manages shared data, ensuring consistency across instances.
  2. Scalability: Amazon EFS functions as a dynamic storage solution, capable of adjusting its capacity based on incoming data. This makes it particularly useful when the anticipated data volume is uncertain.
  3. Simplified Data Sharing: In cases where different applications require access to the same data collaboratively, Amazon EFS is a preferred choice. It facilitates the seamless sharing of large datasets across a group of instances.
  4. Use with Serverless Applications: Amazon EFS is well-suited for integration with serverless computing services, including prominent examples like AWS Lambda. This compatibility makes it an advantageous choice for serverless application architectures.
  5. Pay-as-You-go Model: In instances where your application experiences unpredictable storage growth, Amazon EFS offers a flexible payment model. There’s no requirement for upfront payments or prior commitments; you only incur charges for the storage utilized.

Before selecting a specific service for your application, a thorough analysis of the cost implications and data requirements is essential. This ensures informed decision-making aligned with your application’s needs.

AWS EFS pricing

In the Amazon EFS, you can pay only what you use. There are no setup fees required. It has two storage classes such as standard storage and infrequent access storage.

Here’s the detailed breakdown of the AWS EFS pricing:

Standard Storage Class (Default)
      • Designed for active file system workloads.
      • Pay only for the storage space used per month.
      • Ideal for consistently used file systems
Infrequent Access Storage Class
      • Cost-effective option for rarely accessed files.
      • Lower cost compared to Standard Storage Class.
      • Charges are incurred for each read or write operation.
Bursting Throughput (Default)
      • No additional charges for bandwidth or requests in the default Bursting Throughput mode.
      • Includes a baseline throughput of 50 KB/s per GB in the storage price.
      • Suitable for workloads with varying activity levels.
Provisioned Throughput
    • Allows independent provisioning of file system throughput.
    • Pay separately for storage and throughput.
    • Offers 50 KB/s per GB (or 1 MB/s for 20 GB) of throughput within the storage price.
    • Charges apply only for extra throughput beyond the baseline provided based on stored data.

How does Amazon EFS Differ from other storage classes?

Feature Amazon EFS Amazon EBS Amazon S3
Cost $0.3 per GB/month, with an additional $6 per MB/month for provisioned throughput Monthly cost ranges from $0.045 to $0.125 per GB (depending on volume type) Monthly cost ranges from $0.021 to $0.023 per GB (depending on total storage)
Performance Supports up to 500k IOPS, offers 10+ GB/s throughput, with a minimum of 3 GB/s Performance varies by volume type, ensuring a minimum of 3 IOPS per GB of storage Handles 3500 PUT/LIST/DELETE requests per second, along with 5500 GET requests per second
Availability and Accessibility Highly available with no defined SLA percentage, accessible by up to 1K instances from multiple AZs or Regions Guarantees 99.99% availability, accessible through a single EC2 instance Maintains 99.99% availability, accessible via the Internet and API
Access Control Access is managed through user and group-level permissions. File access requires endpoint access Access is controlled through IAM and security groups IAM and bucket policies govern access
Storage and File Limits Offers unlimited storage size and supports up to a 47.9 TB file size Provides 16 TB of storage per volume with unlimited volumes. The file size is limited by volume size Allows unlimited storage size with a maximum file size of 5 TB

How to configure and connect to Amazon Elastic File System ?

In this hands-on laboratory session, you will be guided through the process of connecting and configuring Amazon Elastic File System (EFS). The practical exercises will provide you with a comprehensive understanding of establishing a connection between Amazon Elastic File System and Amazon Elastic Compute Cloud (EC2).

To initiate the lab exercises, follow these steps:

  • Access the Whizlabs hands-on labs page. A premium subscription is required to access the lab’s page, you must need a premium subscription.
  • Once on the lab’s page, utilize the search bar to type “Mount Elastic File System (EFS) on EC2
  • Select the relevant lab from the search results.
  • Before setting up the lab environment, thoroughly review the lab details provided. This information will ensure you have a clear understanding of the tasks involved.
  • Follow the step-by-step instructions provided in the guided lab.
Task 1: Sign in to the AWS Management Console
  • Click the “Open Console” button to access the AWS Console in a new browser tab.
  • On the AWS sign-in page, leave the Account ID as default. Do not edit or remove the 12-digit Account ID.
  • Copy your User Name and Password from the Lab Console to the IAM Username and Password in the AWS Console. Click “Sign in.”
  • Once signed in, set the default AWS Region to US East (N. Virginia) us-east-1.
Task 2: Launching two EC2 Instances

Ensure you are in the N. Virginia Region.

Navigate to Services > EC2 > Instances > Launch instances.

Set the number of instances to 2, name them as MyEC2-1 and MyEC2-2.

Choose Amazon Linux 2 AMI, t2.micro instance type, and create a new key pair named MyEC2Key.

Launching two EC2 Instances

Amazon EFS Instance type

Click on each instance and name it as MyEC2-1 and MyEC2-2.

Amazon EFS MyEC2-1 and MyEC2-2

Configure network settings, create a security group (EFS Security Group) and launch the instances. Note the IPv4 Public IP Addresses of the EC2 instances.

Task 3: Creating an Elastic File System

Navigate to Services > EFS > Create file system.

Creating an Elastic File System

Customize the file system details, name it EFS-Demo, and ensure the default VPC and regional options are selected. Uncheck “Enable automated backups” and proceed.

Configure Network Access by selecting the VPC, all Availability Zones, and the EFS Security Group.

Creating an Elastic File SystemClick through optional settings and review before clicking “Create.” 

Now it’s time to mount the EC2 Instance with the EFS File system.

Creating an Elastic File System

Task 4: Mount the File System to MyEC2-1 Instance

Copy the IPv4 Public IP of MyEC2-1.

SSH into MyEC2-1, switch to root user, update and install the NFS client by running the commands:

  • switch to root user: sudo -s
  • Run the updates: yum -y update
  • Install NFS client as amazon-efs-utils: yum install -y amazon-efs-utils
  • Create a directory ‘efs’ and mount the file system using the provided command: mkdir efs
  • Display information for all currently mounted file systems using df -h.

Next, mount the file system in this directory.

Once you’ve clicked on “Attach” in the AWS console, you should see instructions on how to mount your EFS file system using the EFS mount helper. Typically, the command looks something like this:

Mount the File System to MyEC2-1 Instance
Mount the File System to MyEC2-1 Instance

Create a directory in the current location:

Mount the File System to MyEC2-1 Instance
Task 5: Mount the File System to MyEC2-2 Instance

Copy the IPv4 Public IP of MyEC2-2.

To mount SSH into MyEC2-2, follow below steps and enter respective commands:

  • switch to root user:sudo -s
  • update: yum -y update
  •  Install the NFS client: yum -y install amazon-efs-utils
  • create a directory ‘efs’: mkdir efs

Now, mount the file system in mkdir directory. To do so, visit the AWS console and click on created file system. On the top-right corner, select the Attach option.

Copy the command: sudo mount -t efs -o tls fs-2ad0a9a8:/ efs

To display information for all currently mounted file systems, you can use the following command: df -h

Mount the File System to MyEC2-2 Instance

Task 6: Testing the File System

SSH into both instances in a side-by-side view on your machine, if possible.

  • Switch to root user:sudo -s

  • Navigate to the efs directory in both the servers using the command: cd efs

  • Create a file in any one server: touch hello.txt

  • Check the file using this command: ls -ltr

  • Now go to the other server and key in the command: cd efs

You can see the file created on this server as well and it shows that EFS is working successfully.

You can try creating files (touch command) or directories (mkdir command) on other servers to continue the EFS deployment.

Testing the File System

Task 7: Validation Test

Click the “Validation” button to assess whether the lab steps are completed successfully. The validation checks AWS resources and confirms the successful implementation of the lab.

AWS EFS Use cases

Here are the common use cases of Amazon EFS:

Amazon EFS use Cases

  • Secure File Sharing: Amazon EFS provides a secure and efficient method for sharing files, ensuring a high level of security while maintaining consistency across the entire system.
  • Web Hosting: Well-suited for web servers, Amazon EFS enables multiple web servers to access the file system, offering a scalable solution that adjusts seamlessly as data volumes increase.
  • Modernize Application Development: EFS facilitates efficient data sharing across AWS resources like ECS, EKS, and serverless web applications. This streamlines application development without requiring extensive management efforts.
  • Machine Learning and AI Workloads: Amazon elastic file system is particularly well-suited for large-scale AI applications, providing an optimal environment where multiple instances and containers can access the same data. This improves collaboration and reduces data duplication, enhancing the efficiency of machine learning and AI workloads.

Advantages of AWS Elastic File System (EFS)

The core benefits of using AWS Elastic File System (EFS)such as:

  • Scalability and Elasticity: EFS is scalable and elastic, allowing dynamic adjustments based on the amount of data to be stored. Scaling occurs automatically, simplifying management.
  • Simultaneous Access: Multiple instances within AWS can concurrently access EFS, facilitating seamless data sharing across instances.
  • Availability Across Availability Zones: In the same region, EFS replicates data across multiple availability zones, enhancing data availability and redundancy.
  • Backup Capabilities: EFS enables periodic data backups, providing a safeguard against data loss. This ensures that you always have a backup available when needed.
  • POSIX File System Features: EFS supports a wide array of POSIX file system features, making it compatible with many Linux-based applications.

Limitations of AWS Elastic File System (EFS)

  1. Protocol Limitation: EFS exclusively supports the Network File System (NFS) protocol. Devices that do not support NFS cannot mount or access EFS.
  2. Maximum File Size: EFS imposes a maximum file size limitation of 47.9 TB.
  3. Throughput and IOPS Limitations: Each file system in EFS has a maximum throughput of 1000 MB/s and a cap of 16,000 IOPS, potentially impacting high-performance requirements.
  4. File and Directory Limits: The number of files and directories within a single file system is determined by its size. For instance, a 1 TB file system can support approximately 20 million files and directories.
  5. Regional Availability and Data Migration: EFS is available only in specific regions, and data migration between regions is not supported.

FAQs

Why use EFS instead of EBS?

EFS stands out for its ability to be mounted with multiple EC2 instances, unlike EBS.

What are the characteristics of an Amazon EFS?

Amazon EFS is highly scalable in both storage capacity and throughput performance.

Mention the Amazon EFS backup options.

Amazon EFS offers the following backup options:

  • AWS DataSync
  • AWS Backup
  • AWS Transfer Family
  • EFS-to-EFS Backup
  • Amazon S3 (Simple Storage Service
  • Amazon Glacier

Conclusion

Hope this article explored the basics of Amazon Elastic File System (EFS) in detail through our hands-on labs. Throughout this exploration, we delved into the key aspects of setting up, managing access, optimizing performance, and ensuring data durability.

Whether for shared file storage, serverless applications, or other use cases, Amazon EFS provides a powerful and flexible foundation for AWS users.

About Pavan Gumaste

Pavan Rao is a programmer / Developer by Profession and Cloud Computing Professional by choice with in-depth knowledge in AWS, Azure, Google Cloud Platform. He helps the organisation figure out what to build, ensure successful delivery, and incorporate user learning to improve the strategy and product further.

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top