Kafka AND REST for communication between microservices?

Daniel Eisenreich

I am currently working on an architecture see below. First I'm not sure if this kind of architecture is called an event-driven or a data-driven architecture or maybe both.

There some input messages are sent from the Frontend to T1. These messages are first validated, then collected and in the end evaluated.

My current approach is to persist the raw messages with all meta information in MS A, the sorted collections in MS B and the evaluations in MS C. This separates the data to the appropriately concerned microservices.

In T2 I only produce the messages which MS B requires.
In T3 I only produce the messages which MS C requires.
But when evaluation the collections all meta information from MS A is required. So how to proceed with this kind?

  1. Should I send only the minimum of data to the queue and provide an API?
  2. Should I send all data to the queues (forward data for following services)?
  3. Should I send all information for the next service to the queue and provide an API?
  4. Something else?

Or did I misunderstand the approach "Communicating microservices through Kafka"?

Please feel free to offer criticism!
Thanks for advice!

Constantin Galbenu

I believe that this is a message-driven and a data-driven architecture, but this should not be important. What it is more important is that the microservices use Choreography (as opposed to Orchestration). This question could help.

The cleanest architecture would be to put all the data in the messages, in this way the number dependencies is limited to 2. Also, the resilience of the system is increased: if the microservice A is down, the other downstream microservices could continue to work.

Every microservice consume only the part of the message that interests it and ignores the other. This creates a nice and extendable pipeline of stream-like processing. If, however, the message is too big, you should use the Microservice A (or any other microservice) as the reference for more data.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related