I'm moving from a coupled architecture to a decoupled architecture using microservices with AWS Lambda.

Here is my current architecture:

enter image description here

Each API Gateway route is linked to a specific Lambda, each of them has a specific task, but they all share common code.

Pain points:
- I have to deploy all the Lambda when modifying shared code.
- Reusing code despite reusing microservices.

What I would like to do:

enter image description here

The code that is in charge of checking client inputs, call specific business code and formating the output is hosted in what I called "AWS Lambda API Gateway" (on my chart) or lambda linked to the public API.

The business code is hosted in several Lambdas that are grouped in identified services. (A and B in my example).

I have some questions regarding this design:

  1. Wich protocol should I use to connect the different lambdas:

    • Making calls from lambdas linked with the public API to service's lambdas.
    • A lambda from a service that calls a lambda from a same service.
    • A lambda from a service that calls a lambda from a different service.
  2. Cleanest way to version services and having a mechanism to fallback on a different version of a service?


  • About the communication protocols between the lambda linked with the public API:
    • The lambdas linked to the public API communicate with the service's lambdas, through a private API served with API Gateway for CRUD request.
    • The lambdas contained in services communicate with other service's lambdas through API Gateway (for synch tasks) or SNS/SQS (for async tasks)
  • Just thinking out loud, could you achieve your goal by having lambda feed events into a service which then calls the relevant service\API in a broker like fashion? – ServerMonkey Dec 12 '16 at 22:13
  • @ServerMonkey could you give me more informations please? – Jean Lbr Dec 13 '16 at 8:44
  • @ServerMonkey after further researches, I came to your point. I edited the OP to add my thoughts. Feedbacks are welcomed – Jean Lbr Dec 13 '16 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.