DEV Community

Panda Quests
Panda Quests

Posted on

When do you use Apache Kafka instead of REST and vice versa?

Top comments (2)

Collapse
 
rad_val_ profile image
Valentin Radu • Edited

You can’t really compare the two. Apache Kafka is a distributed streaming platform. In plainer words, a technology that helps you reliably pass information (data streams) between multiple actors. It’s mostly used as a smarter pubsub messaging queue, facilitating communication between microservices. You could compare it with RabbitMQ, ZeroMQ or even Redis (as a poor’s man choice)

REST is a protocol on top of HTTP that standardizes the way we’re synchronously (aka waiting for a response after each request) reading, writing and deleting remote resources.

However, if you're actually asking why and when you should use a messaging queue versus when you should simply call other services using REST in a microservices architecture, then I would advise to always use a messaging queue.
Here's an article I've wrote regarding this topic here on dev.to which touches this topic among other things related to microservices.

Collapse
 
_andy_lu_ profile image
Andy Lu

These are two very different things in my mind, and not something you make a decision between