4 ms·
Just my 2c but for anyone unaware, you should check out NATS. It combines the best of both Kafka and RabbitMQ IMO.
by pnpnp 3y ago
Just my 2c but for anyone unaware, you should check out NATS.
It combines the best of both Kafka and RabbitMQ IMO.
- doctor_eval 3y agoI thought NATS didn't actually store messages, am I mistaken? Looking at Wikipedia (https://en.wikipedia.org/wiki/NATS_Messaging https://en.wikipedia.org/wiki/NATS_Messaging) I see that I'm technically right, it's JetStream that does the storage layer - but it's part of the NATS server. From memory, I really liked the philosophy of NATS but found the nomenclature confusing.
- pnpnp 3y agoI think they call that part of NATS “Jetstream” if I’m not mistaken. I haven’t used it, but I believe it has some form of message persistence. I have used it mostly for message-first services, and found subject-based messaging a breath of fresh air to decouple services. You can do the same thing with RabbitMQ topic exchanges, but it requires quite a bit more hand-waving.
- zerbinxx 3y agoJetstream does indeed have message persistence: I can issue queries like “get messages on topic since 5 minutes ago” - I do this a ton. However, that seems to be the extent of the storage/query API that it exposes for historical messages. I’m quite a big fan, and would recommend it with the caveat that Jetstream is considerably more complex than simple nats and I get the feeling I’m barely scratching the surface with it.
- doctor_eval 3y agoI’m really interested in a Kafka like message broker in the Go ecosystem and look forward to checking it out for whatever my next project ends up being.
- zerbinxx 3y agoIt’s pretty cool. I would personally suggest Kafka or RabbitMQ depending on your needs, as Jetstream has proven to require a lot of ops engineering to remain stable in production
- rcombatwombat 3y agoNATS JetStream also implements subject-based addressing at the stream level (unlike Kafka where 1 stream = 1 topic, and you can only use the message's key for distribution, not for addressing). So you can for example ask for [the first/the last/all] of the messages on a particular subject, or on a hierarchy of subjects by using wildcards. All the filtering is done at the server level.