How to Use EFS With AWS Lambda
How to utilize the old/new feature with Lambda to empower your Serverless application/architecture.
Join the DZone community and get the full member experience.
Join For FreeAWS recently launched a new feature that lets the customer make an EFS (Elastic File System) that works with Lambda. This is really cool! But, Why EFS?
EFS is a storage unit that lives independently inside a machine. This file can be attached to other services like EC2 and can be accessed from multiple instances at once. Files that are inside this storage unit are accessible from any connected instance or Lambda.
Why do we need something like this to work with Lambda? Extra complicated step?
Actually, this feature is amazing if you looked at it from different angles. Let’s start with some of them:
Consistency
If you need multiple Lambdas to use (read and write) BIG files, you’ll need them to be in a place that doesn’t delay the function to get the resources, which leads to less computing power and time -> less money.
More Space
When you’re working with files from S3, you’re limited to the max storage size of 512 MiB. This is not enough is some cases. Plus, you might need to work with this file in different processes stages, like cleaning, segmenting, processing, and exporting readable reports/formats of this file. Imagine the amount of code involved in this scenario.
More Space 2
Using layers will share the resources between the functions, but Layers sometimes can’t handle the size of the resources and binaries you called to run this function. Using EFS will give you more room to store these resources and call when is needed.
I can list more points. But, you get the idea. Let’s dive into how to use it with lambda.
Creating EFS
1. Open AWS console and search for “EFS”
Opinions expressed by DZone contributors are their own.
Comments