Hey,
My name is Sarvar, and I am a highly skilled Senior Developer at Luxoft India. With years of experience working on cutting-edge technologies, I have honed my expertise in Cloud Operations (Azure and AWS), Data Operations, Data Analytics, and DevOps. Throughout my career, I’ve worked with clients from all around the world, delivering excellent results, and going above and beyond expectations. I am passionate about learning the latest and treading technologies.
Today we are looking into Amazon’s one of the most popular Serverless storage options, the Amazon elastic file system, AKA Amazon EFS. We will learn what the Amazon elastic file system is, how it works, and some of its advantages. Most importantly we will see the difference between Amazon S3 and Amazon EFS. We will also go through the process of mounting this Amazon elastic file system in an Amazon EC2 instance.
What is Amazon Elastic File System:
AWS offers the fully managed file storage service known as Amazon Elastic File System AKA Amazon EFS. It is made to give applications running in the AWS cloud scalability and dependable storage. Multiple Amazon Elastic Compute Cloud (EC2) instances can access files stored in EFS at the same time with ease and flexibility. Scalability is one of Amazon EFS’s main benefits. By automatically adjusting storage capacity when new files are added, manual capacity management is no longer necessary. Because of its scalability, it can handle a variety of workloads, from small applications to massive data-intensive workloads.
Security is also another crucial element of EFS. It offers a number of security features, including industry-standard encryption protocols for encryption both at rest and in transit. Data storage and transmission between EC2 instances and the EFS file system are made safer as a result. EFS’s distributed architecture ensures that data is highly available and durable. Since EFS is distributed, thousands of EC2 instances can access it concurrently, allowing numerous instances to read and write data at the same time. Because of this, it is perfect for applications that call for shared access to a single data collection.
We can easily integrate the Amazon EFS with Amazon EC2 Instances. An EC2 instance can use and access the shared file storage by mounting the EFS file system on the instance. Applications running on EC2 instances can successfully share data and work together thanks to this. We will discuss how to mount the Amazon EFS with an AWS EC2 instance at the final stage of this article.
Difference Between Amazon S3 & Amazon EFS:
The actual differences between S3 Storage and EFS Storage will be discussed at this point because most individuals are unsure which storage option is best for them. The storage models and access behaviors that distinguish Amazon S3 and Amazon EFS are what matter most. Large volumes of unstructured data can be stored and retrieved via a RESTful API using object-based storage called S3. On the other hand, EFS offers concurrent access to file-level storage, making it appropriate for applications that need shared access to files across several EC2 instances. Your individual needs, such as the kind of data you need to store and the access patterns your applications demand, will determine whether you choose S3 or EFS.
Features of Amazon EFS:
Here are some of the Features of Amazon EFS
1. Elasticity:
Thousands of EC2 instances can access Elasticity EFS concurrently, allowing numerous instances to read and write data at the same time.
2. Accessibility:
Strength and Accessibility By storing data across different Availability Zones within a region, EFS is intended to offer great durability and availability. This promotes high application availability while preventing data loss.
3. Scalability:
In order to guarantee that applications have the storage they require without provisioning and managing capacity, EFS automatically grows storage capacity as files are added.
4. Performance:
EFS is suited for applications that need shared access to a file system since it is built to deliver low-latency performance for a variety of file workloads.
5. Security:
EFS offers a number of security features, including the use of industry-standard encryption techniques for both encryption at rest and encryption in transit.
How to Create Amazon EFS:
Here we are using CFT and Terraform to create our Amazon EFS Storage -
1.Using CFT:
Just take the below code and create one CFT file using YML format and upload it to the cloud formation. It will create one Amazon EFS storage in EFS Service.
Resources:
MyEFS:
Type: AWS::EFS::FileSystem
Properties:
FileSystemTags:
- Key: Name
Value: New_EFS
2.Using Terraform:
Just take below code and create one .tf file. once you run terraform apply command it will create Amazon EFS storage with name of “EFS-STORAGE”.
resource "aws_efs_file_system" "new-efs" {
creation_token = "efs-token"
tags = {
Name = "EFS-STORAGE"
}
}
Let’s Integrate Amazon EFS to Amazon EC2 Instance:
Here we are looking at the integrating Amazon EFS with EC2 Instance to leverage all the benefits of the Amazon EFS. I'm considering Amazon Linux . So below mention all the commands are suitable for Amazon Linux.
1. Install the NFS client for EFS Integration:
We need to install NFS which also know as Network File System. it will be responsible for managing ang integrating the Amazon EFS with Amazon Ec2 Instance. Just run below command to install NFS Client.
sudo yum install -y nfs-utils
2. Create One Directory on Amazon Linux:
We have to create on custom directory which we will use later for mounting Amazon EFS to that directory.
suod mkdir /mnt/efs-storage
3. Mount Amazon EFS:
Just run below command to mount newly created Amazon EFS to the /mnt/efs-storage directory. You have to provide the DNS name which you will get on Amazon EFS service Dashboard.
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 <mount-target-DNS-name>:/ /mnt/efs-storage
Note: To avoid Amazon EFS configuration and connection lost on instance Reboot you can add amazon EFS entry in /etc/fstab. it will help us to automatically mount Amazon EFS on instance reboot.
Conclusion: For applications running in the AWS cloud, Amazon EFS offers a scalable, dependable, and adaptable file storage solution. Media management, website serving, big data analytics, docker storage, and development and testing environments are just a few of the use cases where it is frequently utilized. It is an excellent option for applications with dynamic storage needs due to its capacity to scale automatically, highly secure, enable concurrent access, and offer great durability.
— — — — — — — —
Here is the End!
Thank you for taking the time to read my article. I hope you found this article informative and helpful. As I continue to explore the latest developments in technology, I look forward to sharing my insights with you. Stay tuned for more articles like this one that break down complex concepts and make them easier to understand.
Remember, learning is a lifelong journey, and it’s important to keep up with the latest trends and developments to stay ahead of the curve. Thank you again for reading, and I hope to see you in the next article!
Happy Learning!