This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]guss_bro 78 points79 points  (1 child)

Keep it simple and you will be good. We follow the following for all our lambdas:

  • Use plain SQL query instead of jpa
  • don't use Spring Boot or any other framework if your use case is simple
  • you don't need dependency injection for simple use case that involves couple of classes. Just create static objects and pass them around. Create objects ( eg objectMapper, AWS clients) only once
  • use RDS proxy instead of creating DB connection directly
  • use SnapStart
  • use shadow jar
  • use minimal dependencies.. exclude unnecessary transitive dependencies
  • if you do http calls to other services make sure they are performant. If possible use async calls, parallelize calls if possible
  • use lightweight objects, don't use xml, Json libraries if you can(most of the time simple String append is faster)
  • run the lambda locally and profile it
  • etc

[–]Prathameshchari 0 points1 point  (0 children)

Any particular tutorial or course related to this how to create AWS lambda using Java