When can I choose Amazon EFS (elastic block store) and elastic file system for the need of the storage infrastructure?
I am a cloud architect and I am currently designing the storage infrastructure for a cloud-based application. In this particular task, when can I choose Amazon EFS(Elastic file system) over Amazon EBS(Elastic block store) for the need for Storage?
In the context of AWS, here are the explanations given to decide between using Amazon EFS and Amazon EBS:-
Amazon EFS (Elastic file system)
It is highly scalable and can grow or even shrink quickly and automatically based on the needs of the storage for your particular application.
It can allow you to handle thousands of concurrent connections. Thus, is also suitable for scenarios where you need to share data across multiple instances or even containers.
It is designed in a manner so that you can have high durability of it.
Amazon EBS(Elastic block store)
This particular is also scalable however it requires manual resizing or even provisioning additional volumes during the time of storage needs increase. Thus, it is suitable for applications that demand consistent and predictable performance with some specific requirements.
It can provide also good durability for most use cases however, it is possible that it can demand additional replication or even a backup system for the critical data.
Here is a simplified example given of how you can Create an EFS file system and even an EBS volume system by using the Python programming language in Boto3:-
Import boto3
# Initialize the EFS client
Efs = boto3.client(‘efs’)
# Create an EFS file system
Response = efs.create_file_system()
# Initialize the EC2 client
Ec2 = boto3.client(‘ec2’)
# Create an EBS volume
Response = ec2.create_volume(
AvailabilityZone=’us-west-2a’,
Size=100, # Size in GiB
VolumeType=’gp2’ # EBS volume type
)