Giter Club home page Giter Club logo

Comments (2)

nmoutschen avatar nmoutschen commented on June 16, 2024 1

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.

dashmug avatar dashmug commented on June 16, 2024

Thank you @nmoutschen. It makes sense now.

I will close this issue.

from aws-serverless-ecommerce-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.