Answer the question
In order to leave comments, you need to log in
How to organize the work of microservices in kafka?
Hello. There are three services that roughly speaking implement an online store:
1. Accepts a request and sends it to kafka.
2. Reads from kafka and is responsible for the goods.
3. Reads from kafka and is responsible for the user's wallet.
That is, when a request with the number and name of the goods the user needs arrives at service 1, then we go to service 3, take information about the goods, send them to service 2 and withdraw money from the user, and in conclusion we answer service 1 about the result.
There were questions about the organization of the work of services:
1. Is it necessary to synchronize the work of services here (i.e., execute requests one by one), because it is possible that users buy goods at the same time, and there is only enough of it in the warehouse for one user? And if so, how to implement it?
2. Have I built the communication algorithm between services described above correctly?
PS: Little is known about microservice architecture and Kafka.
Answer the question
In order to leave comments, you need to log in
Why Kafka? Why microservices?
1. Accepts a request and sends it to kafka.From whom does he receive and how? What is the response and how?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question