3

In traditional application development using Spring-boot / nodeJS, we have a controller/router in which we create different methods to handle appropriate HTTP request

Reservation Controller / Router
    GET getReservation(id)
    POST createReservation()
    PUT updateReservation()
    GET getAllReservation()

Controller/router calls the service classes to get the job done. Assume that you have multiple controller/service classes like this.

Now my quesiton is, If I need to create similar application using AWS lambda, I have to create multiple lambda functions separately which do not seem to be organized under a controller. (I understand that API Gateway is the controller here - please correct me if it is not). How to organize lambda functions / what is best practise you follow for your serverless architecture?

1 Answer 1

2

There is no strict architecture to develop what you want. It depends on your need for isolation and maintenance. You can do it either way with Lambda.

If your code is small enough for all methods. You can perform ANY integration with API Gateway, that will get all the methods under control of single Lambda.

If you want to separate the code to own lambda's, you can create independent lambda and deploy them separately. If you have dependent libraries across all of your methods, you can share them with Lambda Layers.

Both of the above approaches discussed here

Hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.