scalaakka-streamapache-kafka-streamstypesafestream-processing

Akka Stream Kafka vs Kafka Streams


I am currently working with Akka Stream Kafka to interact with kafka and I was wonderings what were the differences with Kafka Streams.

I know that the Akka based approach implements the reactive specifications and handles back-pressure, functionality that kafka streams seems to be lacking.

What would be the advantage of using kafka streams over akka streams kafka?


Solution

  • Your question is very general, so I'll give a general answer from my point of view.

    First, I've got two usage scenario:

    1. cases where I'm reading data from kafka, processing it and writing some output back to kafka, for these I'm using kafka streams exclusively.
    2. cases where either the data source or sink is not kafka, for those I'm using akka streams.

    This already allows me to answer the part about back-pressure: for the 1st scenario above, there is a back-pressure mechanism in kafka streams.

    Let's now only focus on the first scenario described above. Let's see what I would loose if I decided to stop using Kafka streams:

    Those are the biggest differences that matter to me, I'm hoping that it makes sense to you!