0

Does it make sense and what would be a reasonable way to implement the following:

This could happen for either single instances or a time series of data. There could be several micro-services consuming data (from kafka for example) and performing some kind of classification and assigning either binary or discrete value. How could we reasonably combine the results of such "voting" to save or present single value result.

I'm thinking about another microservice which would match the data (in case of time series by some identifier) but it would need to know how many votes to expect or could assume that the result should appear within some timeframe, but then it gets a bit less asynchronous.

r3nw0rp
  • 61
  • 1
  • 6

1 Answers1

0

There is an example below which does something similar to this. The code provides an interface for submitting new Orders, having them validated by a set of three services, then querying the result.

Orders are validated by three different microservices. Each one emits a pass or fail as to whether the validation passes. Back in the Orders Service a Kafka Streams job collects the validation results and aggregates an overall pass or fail.

https://github.com/confluentinc/kafka-streams-examples/tree/4.0.0-post/src/main/java/io/confluent/examples/streams/microservices

https://www.confluent.io/blog/building-a-microservices-ecosystem-with-kafka-streams-and-ksql/

This model should work for your use case too.

Ben Stopford
  • 156
  • 2