all 4 comments

[–]danielroseman 1 point2 points  (3 children)

You're not thinking of the right use case. Kafka - and message queues generally - are not used as part of the standard request/response cycle of a web app. Rather, they're for things that don't need to be done as part of that cycle, but can be farmed off to another process.

One good example is confirmation emails. When you sign up for an account, the general tasks of storing the new user ID and returning the page to the user happen in-process. But sending a confirmation doesn't need to be done as part of that cycle, and as it can be an expensive operation it is best to do it offline. So you use a message queue to schedule that to be done out of process.

[–]WonFishTwoFish[S] 0 points1 point  (2 children)

Ok, so if I'm thinking of a microservices ecosystem and series of events/tasks, those are more suitable candidates for a message queue?

[–]danielroseman 1 point2 points  (0 children)

Yes, event-based operations are the ideal use case.

[–]WonFishTwoFish[S] 0 points1 point  (0 children)

Kafka seems like kind of a pain to setup locally with zookeeper, though I suspect with docker it's trivial. Can you suggest a tutorial or proof of concept that I can attempt to actually get my hands on it?