How to organised Java Lambda Handler project

Still Learning :

Recently I started working on AWS Lambda using Java and may be I need to write 100 of lambda function. I am completely new in this serverless architecture.so I have following question. Do I need to create only one project for all Lambda function or one project for each function. Currently following first one and already designed more then 10 function in one project. I avoid use of springboot and spring for quick startup and less dependency. Already jar size is more than 20 MB. I mean is following pattern correct?

is it correct approach to start or do we have some better approach.

enter image description here

I have all the handler in single project and of course AWS will point to difference handler for its each functionality. and what I wanted to ask , is it good design to keep them together or do I need to have different project/module for each lambda. like deleteuser, disableUser etc. Please guide me to start.

enter image description here

Thanks

Sandeep Lakdawala :

One project for all Lambda functions should be fine as, finally the Lambda Function will need to be configured to its respective Handler. Check this similar stackoverflow thread.

Is it feasible to create multiple Lambda functions (Java) in a jar

For Application Memory footprint, try to deploy the Lambda application and check the cold start times and memory footprint as, these 2 will determine your Lambda costs to an extent.

Frameworks like spring-boot tend to cause longer startup times.Other alternatives you could consider.

  1. If your application logic is simple enough,avoid using any framework and just use core java.

  2. Spring Cloud Function- You could consider this as a spring boot version for developing serverles applications(Ofcourse there is a lot more to it)

    https://spring.io/projects/spring-cloud-function

  3. Try Quarks as, they claim to have far lesser memory footprint and application startup times.

    https://quarkus.io/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=277610&siteId=1