1

Consider a web application which can have an event where a user uploads some text and there are 3 services (sevices A, B, C) that need to perform operations on the uploaded text in real-time. Would Kafka be the best choice for this?

I am hesitant to say that it is because it would require the upload message to be sent to the central Kafka queue. Then each of the three services would consume the messages, then perform their services, then send the results back to Kafka, then they would be sent back to the web app. So this would require 4 hops (web app to kafka, kafka to service, service to kafka, kafka to webapp). Having said this, is this practical for this to be used for a realtime web app?

user1893354
  • 5,778
  • 12
  • 46
  • 83
  • IMO a messaging service is not suitable for such a use-case. When there are multiple services involved, an eventual consistency based approach works better - http://stackoverflow.com/a/33678191/24424 – Rahul Jan 19 '16 at 17:25

1 Answers1

0

I am not an expert but as far as my research goes most 'realtime' web applications are based on the Reactive Manifesto.

Consider looking into RxJava, Akka (looks like you already use Scala), Vertx or such.

Community
  • 1
  • 1
Christophe Roussy
  • 16,299
  • 4
  • 85
  • 85