I'm moving from a coupled architecture to a decoupled architecture using microservices with AWS Lambda.
Here is my current architecture:
Each API Gateway route is linked to a specific Lambda, each of them has a specific task, but they all share common code.
- I have to deploy all the Lambda when modifying shared code.
- Reusing code despite reusing microservices.
What I would like to do:
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:
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.
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)