P
P
Puritan2020-07-08 21:22:43
Software design
Puritan, 2020-07-08 21:22:43

How to deliver data to microservices via Event?

Tell me the best practice for using Event Driven Architecture.

I will describe the situation: there are many microservices that consume events from one, central, monolithic system. Each MS performs its own task and, accordingly, requires its own set of data. Only the monolith owns the complete set of data.

Question: how to deliver the necessary data to the MS:
1) expand the payload for the event each time in order to satisfy the need for some fields for the MS
2) generate different events, with a different data set, i.e. each MC uses a specific event prefix.?
3) do all MCs receive one event and do the missing
data reach the API of the monolith?

The last option is the most appropriate, in my opinion. Is this correct, from the point of view of the EDD ideology?
Please share your experience.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-07-08
@inoise

It all depends on the lifecycle of the data. It must be understood that the event system is not required to work in real time. For some cases, it is necessary to expand the payload, and for some it is the other way around. For example, if your microservice creates an order based on a user request, then it is logical to send a user request to payload, and if the microservice warms up the cache, then it is logical to issue a minimum of data to take the rest from the database. And in both cases, most likely, in fact, there will be a combination

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question