NFS mount across EC2 instances as alternative to EFS

amazon-efsamazon-web-servicesnfs

I'm configuring an application to run in AWS in "full-framework" deployment. One aspect of this deployment requires each server to be able to see a common storage location. They recommend using a WebDAV server, but we'd prefer to use some kind of shared mounted drive.

EFS is the perfect solution here… but it isn't available in my region.

Alternatively we thought of setting up an NFS mount. Is it possible to mount an NFS on an EBS volume to act similarly to an EFS? Any advantages/disadvantages to doing so?

Best Answer

I would be cautious of the S3fs recommendation. S3 isn't designed to be a file system and has some limitations when an application expects it to be. S3 is eventually consistent, meaning an update may or may not be reflected in a timely fashion. S3 has no concept of partial changes, so using a log file as an example, if you're appending or otherwise altering, the entire file gets re-uploaded on every change. This can become costly. S3FS tries to utilize a local cache to avoid excessive transfers, and this adds another layer of potential inconsistency if something were to happen on that node.

While setting up NFS on an EC2 instance is fairly trivial, you are creating a single point of failure (SPOF) in your design (if the instance or EBS goes away, your application is impacted). Also, cross-AZ traffic from other instances to your NFS one will incur bandwidth charges.

If you're looking for an enterprise grade NFS and cannot use EFS, there are Marketplace offerings (aws.amazon.com/marketplace), but you can also go opensource and use GlusterFS mounted as NFS with multiple EC2 instances to avoid a SPOF and keep traffic within AZs: https://docs.gluster.org/en/latest/Install-Guide/Setup_aws/ (but, Gluster can be a beast in itself to manage)

Related Topic