Giter Site home page Giter Site logo

Comments (5)

rkarthik007 avatar rkarthik007 commented on May 31, 2024

It fetches the product data from the product microservice using a REST API. Note that the API gateway is present for end user authentication and security purposes. The microservices themselves are free to talk directly to each other using REST calls.

from yugastore-java.

simkimsia avatar simkimsia commented on May 31, 2024

Thanks for reply @rkarthik007

The microservices themselves are free to talk directly to each other using REST calls.

They directly talk with each other without going past the API gateway?

So what does the Order microservice store?

When building a monolithic version, the simplest way is to have a Order, Product, and OrderLineItem table.

What happens is that OrderLineItem has both Order id and Product id.

In the microservice model you have, do you store Product id inside the Order microservice? and do the various microservices access the same database or have their own separate database?

from yugastore-java.

rkarthik007 avatar rkarthik007 commented on May 31, 2024

Sorry for the slow response - @ameyb and @nchandrappa: could you folks chip in? You guys are way more knowledgeable about Spring than me.

from yugastore-java.

nchandrappa avatar nchandrappa commented on May 31, 2024

They directly talk with each other without going past the API gateway?

API-gateway is used for serving customer/public facing APIs which means the UI App or any other clients that want to make use of the backend services will be served out off of API gateway.

All the backend microservices are aware of each other through eureka service discovery and they don't need to go through the API gateway.

from yugastore-java.

nchandrappa avatar nchandrappa commented on May 31, 2024

When building a monolithic version, the simplest way is to have a Order, Product, and OrderLineItem table.
What happens is that OrderLineItem has both Order id and Product id.

In microservices architecture, domain driven design is widely adopted to identify the bounded context of each microservices. At the end of day, advantages of moving to MS architecture is to enable faster prototyping and each of the microservices can progress at their own speed right.

Following this design principle, we have created Products, checkout, cart microservices and none of them share any state. However each of the them are aware of "api-id" which they use for retrieving the necessary information, this is where magic of service discovery and feign clients come in.

Lets consider the checkout functionality,

UI Checkout Button -> API Gateway -> checkout Microservice ( uses product microservice for Product description, cart microservice to retrieve items in cart )

Table Design:
Checkout Microservice -> Products Inventory, orders (order line item)
Products Microservice -> Products description
Cart Microservice -> cart

Checkout microservice is only responsible for performing transactions on Product Inventory and orders table. @simkimsia

from yugastore-java.

Related Issues (8)

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.