How to use a 15 GB ML library across multiple AWS Lambda functions?
A developer needs to implement a custom machine learning (ML) library in an application. The size of the library is 15 GB. The size of the library is increasing. The application uses AWS Lambda functions. All the Lambda functions must have access to the library. Which solution will meet these requirements?
Community Votes
75% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests your knowledge of AWS Lambda size limitations (250 MB unzipped) and the correct workaround—Amazon EFS—for sharing large, growing dependencies like ML libraries across multiple functions.
When an ML library exceeds the 250 MB unzipped limit for Lambda layers and deployment packages, Amazon EFS must be used to mount the shared library across all Lambda functions. The community overwhelmingly agrees on EFS as the only viable solution for large, growing code packages.
Many candidates choose Lambda Layers (Option A), mistakenly believing layers can accommodate any size or misreading the 250 MB unzipped limit as 250 GB. Some also confuse the total layer count limit with the size limit.
Community Discussion (9 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Understanding AWS Lambda Size Limitations
AWS Lambda imposes strict size constraints on deployment packages and layers. The unzipped deployment package (including all layers) cannot exceed 250 MB. The zipped deployment package is limited to 50 MB per function. These limits are hard boundaries and cannot be increased via service quotas.
Why Amazon EFS Is the Correct Answer
Amazon Elastic File System (Amazon EFS) provides a fully managed, elastic NFS file system that can be mounted directly into Lambda functions. This integration was introduced specifically to address scenarios where libraries, datasets, or binaries are too large for Lambda's native packaging options. By storing the 15 GB ML library on EFS and mounting it to all Lambda functions, the developer achieves:
- No size constraints tied to Lambda's deployment package limits
- Shared access across all functions without duplication
- Scalability as the library continues to grow
- Faster cold starts compared to downloading large files from S3 at runtime
Why the Other Options Fail
- Option A (Lambda Layers): Incorrect. Lambda layers have a combined unzipped size limit of 250 MB along with the deployment package. A 15 GB library vastly exceeds this limit. Community members who voted for A likely confused the total number of layers allowed (up to 75) with the size limit.
- Option B (Amazon S3): Incorrect. While technically possible to download the library from S3 during function initialization, this approach introduces unacceptable latency for a 15 GB download on every cold start. It also consumes ephemeral storage (/tmp is limited to 10 GB by default, expandable to 10 GB max, still insufficient for 15 GB).
- Option C (Lambda Container Image): Incorrect. Container images for Lambda are limited to 10 GB in size. A 15 GB library exceeds this limit. Additionally, redeploying all functions with a new image every time the library grows is operationally burdensome.
Community Consensus
The community strongly agrees (75% vs 25%) that Option D is correct. Multiple commenters cite the 250 MB layer limit and reference AWS blog posts confirming EFS as the recommended pattern for large ML libraries in serverless applications.
Official Reference
Exam Strategy
When you see a Lambda question involving large dependencies (ML models, large binaries, datasets), immediately check if the size exceeds 250 MB. If it does, Amazon EFS is almost always the answer. Eliminate Lambda Layers and container images based on their respective size limits (250 MB and 10 GB).
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →