Comments (2)
Hi @dashmug !
In short, it's a tradeoff between having interfaces that don't leak internal implementation versus cost/latency.
Since the communication is between different services, having API Gateway in the middle means there's a neutral API between the two services that gives the flexibility to make changes to the implementation. If it was Lambda to Lambda, it means that Lambda is now the external contract of that microservice, so I cannot change it to a direct integration, a Fargate container, etc.
On the other side, as you pointed out, it increases cost and latency. On top of two Lambda functions executing, you have additional latency and cost for API Gateway. It's similar to why Lambda to Lambda is generally discouraged: it doubles the cost.
In this case, if cost was a priority over decoupling the two microservices, you could have direct communication with Lambda from service A to DynamoDB in service B (e.g. for the internal orders API). It's the cheapest and most performant option, but that creates an even tighter coupling between the two microservices.
from aws-serverless-ecommerce-platform.
Thank you @nmoutschen. It makes sense now.
I will close this issue.
from aws-serverless-ecommerce-platform.
Related Issues (20)
- Move to main branch
- platform: add archive for event bus
- Update Lambda Powertools
- The main use of non-prod
- cfn-lint issue while make all-${Service} HOT 3
- Stack with id ecommerce-orders does not exist Stack ecommerce-orders not found HOT 1
- Bug : create_order is not idempotent HOT 1
- Build & deploy failing when use using aws developer tools HOT 4
- Move functions to Arm64 HOT 3
- Build error - dependency conflict between awscli and botocore
- AWSCloud9 Permissions Issue HOT 8
- Missing lint command HOT 2
- bug: Unsupported type: cloudformation HOT 2
- FAILED tests/integ/test_events.py::test_table_update - AssertionError
- Is there any frontend example that interacts with this platform? HOT 1
- Need help in understanding how to deploy the code on AWS HOT 1
- Issue with executing make setup command HOT 1
- Error in WebSocket connection After Setup
- Unable to run make all command in the root of the project directory as guided in the getting started page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-serverless-ecommerce-platform.