An EFS filesystem provides simple, scalable, and elastic file storage for your applications. It allows shared access to data using a traditional file permissions model and a hierarchical directory structure. Files stored in an EFS filesystem are persistent, meaning they remain available even if the container or Lambda function that created them is no longer running.
A single filesystem can be mounted by thousands of compute resources concurrently, including Lambda functions and container services. The filesystem is serverless, automatically growing and shrinking as you add and remove files, and you only pay for the storage you use.
Under the hood, Stacktape uses AWS Elastic File System (EFS).
When to use them
EFS filesystems are ideal for use cases that require shared file storage that can be accessed by multiple compute resources at the same time. Common use cases include:
- Web serving and content management
- Media and entertainment workflows
- Home directories
- Database backups
- Container storage
- Big data analytics
Advantages
- Shared access: Can be mounted concurrently by thousands of containers and Lambda functions across multiple Availability Zones.
- Standard file system interface: Uses the NFSv4 protocol, allowing for seamless integration with applications that expect a standard file system.
- Serverless and elastic: Automatically scales storage capacity up or down.
- Highly available and durable: Data is stored redundantly across multiple Availability Zones.
- Performance: Delivers low, consistent latency and high throughput.
- Encryption: Data is encrypted both in transit and at rest.
Disadvantages
- Latency: While latency is low, it's generally higher than with block storage (EBS) due to the distributed nature of EFS.
- Cost: Can be more expensive than object storage (S3) or block storage (EBS) for certain workloads.
- Not optimal for lowest-latency needs: For applications that require the absolute lowest latency for a single instance, EBS might be a better choice.
Basic usage
Mounting to resources
You can mount a filesystem to a compute resource by specifying the volumeMounts property. Stacktape automatically handles the necessary network and IAM permissions.
Mounting a filesystem to a web service.
You can then access the mounted directory just like any other directory in your compute resource's filesystem.
An example of writing to and reading from a mounted filesystem.
Throughput mode
You can set a throughput mode for your filesystem. While there are various options, the elastic mode (the default) is recommended for most use cases.
elastic(recommended): Auto-scales throughput. Best for spiky workloads (web apps, CI/CD).provisioned: Fixed throughput you set viaprovisionedThroughputInMibps. Best for steady high-throughput workloads.bursting: Throughput scales with storage size (50 KiB/s per GiB). Can run out of burst credits.
Backup
You can enable daily backups to protect your data against accidental deletion.
Enable daily automatic backups with 35-day retention. Incremental (only changes are copied).
Limit access
You can limit a resource's access to a specific directory within the filesystem by specifying a rootDirectory.
Subdirectory within the EFS filesystem to mount. Omit for full access.
A Lambda function with limited access to a filesystem.