Comments (5)
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.
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.
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.
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.
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)
- demo-version not work
- Cart Microservice throws exception with Shopping_cart not found
- Optional int parameter 'limit' and 'offset' is present but cannot be translated into a null value due to being declared as a primitive type.
- broken pages for the online version HOT 2
- Errors on dataload.sh
- Errors on docker-run.sh
- Eureka link is incorrect HOT 2
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 yugastore-java.