Singleton initialisation in a multi AWS Lambda scenario #8835
Unanswered
roamingthings
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently thinking about how to optimize AWS serverless applications that include multiple AWS Lambda functions. My aim is to reduce deployment artefact size, number of artefacts, number of Gradle/Maven modules.
Let's imagine I have multiple AWS Lambda handler classes extending something like
MicronautRequestHandler
in one application/jar. These functions require a different set of Singleton beans:When I call Function 2 I would like to have none of the Singleton beans being created to optimize for short cold start times.
When I call Function 3 I would like to have only S3Client being created.
Currently there is a way to set eager Singleton creation. However, this doesn't help in these cases since it either moves Singleton initialisation to execution time.
Beta Was this translation helpful? Give feedback.
All reactions