4 ms·
This is how I feel about NATS: https://nats.io/ https://nats.io/ It's an infinitely more friendly version of Kafka, pub/sub, etc that is extremely lightweight.
by leetharris 2y ago
This is how I feel about NATS: https://nats.io/ https://nats.io/
It's an infinitely more friendly version of Kafka, pub/sub, etc that is extremely lightweight. Yet every environment trends towards Kafka because it was "chosen" by the big corps.
- packetlost 2y agoI've used both and NATS is definitely what I'd pick starting out. RabbitMQ is great too, but its heavier and harder to configure. Federation is the killer feature of RabbitMQ that NATS doesn't really have (afaik?).
- Zambyte 2y agoI've never used RabbitMQ, but NATS supports clustering, super clustering, and leaf node connections. I'm guessing the latter is the closest to what would be considered "federation" in this context. Edit: spelling
- packetlost 2y agoNone of them are close. RabbitMQ has traffic shaping, MQ->MQ routing (federation), and all sorts of stuff that is super important if you use it as a generalized routing system (vs plain IP). NATS doesn't have that and it's almost certainly firmly out of scope.
- tamalsaha001 2y agoNATS can do traffic shaping https://docs.nats.io/nats-concepts/subject_mapping#for-traffic-shaping-in-testing https://docs.nats.io/nats-concepts/subject_mapping#for-traff...
- packetlost 2y agoOh cool, I didn't know it could! Regardless, advanced routing is still something that RabbitMQ has that isn't in NATS. It's not useful for every system, but it is a differentiator. I usually reach for NATS + Jetstream these days, with its object and KV systems it's a really great "all-in-one" for basic stuff.
- je42 2y agoNats also has some basic routing options. Which of RabbitMQ's options would give it the edge when deciding between the two?
- Zambyte 2y agoWhen you say "MQ->MQ routing (federation)" I have a hard time understanding how that is not close to leaf nodes. Leaf nodes allow independently operated / managed NATS servers to share data back and forth, which to me is what federation is about. Do you have any resources you recommend to help me grasp why this is different?
- realcombatwomba 2y agoNATS JetStream has equivalent functionality to federation out of the box with stream sourcing, combined with super-clustering and leaf-nodes. You can have streams that source and combine messages (with filters and subject transformation) from other sources and that sourcing happens in a 'guaranteed store and forward' manner, even if for example the stream being sourced is located in another cluster in a different region or provider or in an edge device (running a leaf node) that has only partial network connectivity (e.g. on a vehicle) and completely different security setup. (for more detail check out this and the other YouTube videos on the Synadia channel https://youtu.be/WH55czo1BNk https://youtu.be/WH55czo1BNk)
- shandor 2y agoSo how about NATS compared to RabbitMQ? If building from scratch, what would drive a design or team towards NATS?
- hyperadvanced 2y agoHave used both extensively: NATS, especially in its most elementary form, is braindead simple, stateless, and ootb functional. If I only want a message broker/pubsub, I pick that. If I know on day 1 that I need queues or persistence, I would probably pick Rabbit over NATS’ offering (Jetstream).
- ehsanu1 2y agoWhat does Jetstream lack wrt queues/persistence?
- hyperadvanced 2y agoIt doesn’t lack anything in particular, it’s just heavier weight compared to Rabbit. I would start with amqp and iterate towards NATS with scale
- Karrot_Kream 2y agoWould you use NATS over Redis PubSub or Postgres Notify/Listen? Postgres's option I'm wary of for reasons I've discussed here before but Redis PubSub seems fairly simple to use and likewise not as uber-scalable as Kafka and other more heavyweight message broker systems.
- atombender 2y agoNot the parent, but I would. We've been using NATS for about five years at my company, and we recently adopted JetStream, and have been really impressed with it. NATS, especially with JetStream now, is a Swiss Army knife of messaging. It can do RPC, Kafka-type batch streaming, low-latency realtime notifications, large-scale network transfer, offline sync, work queues, mirroring, weighted routing, partitioning... it's incredibly flexible. The simple but powerful primitive you have around subject routing/mapping/transforms, stream placement, replication, offline lead nodes etc. are just fantastic. It's super reliable. It scales from tiny apps to huge ones. The CLI and API tooling around streams and consumers is also fantastic. Everything just feels well-designed and sensible. The new key/value store and blob store (both built on top of JetStream as client-side abstractions) are also super neat, and we've started using this functionality.
- varispeed 2y agoBig corps choose these bloated and complex tools because this way they can justify charging their customers premium and also that their customers won't be able to service such software on their own. It's nothing to do with these apps being superior in any way - often it is the opposite - like reasonable faults and glitches can add more hours to bill the customers for "fixing".
- frompdx 2y agoI agree. NATS is much more simplistic to use and deploy. Easy to run locally for development. Jetstream offers useful features like persistent streams, and kv and object stores.
- hendler 2y agohttps://nsq.io/ https://nsq.io/ is also very reliable, stable, lightweight, and easy to use.
- kragen 2y agonats looks more like a more friendly version of rabbitmq or zeromq than of kafka from these docs: https://docs.nats.io/reference/reference-protocols/nats-protocol-demo https://docs.nats.io/reference/reference-protocols/nats-prot...
- raverbashing 2y agoMaybe because in typical developer fashion their website is absolutely dog-crap at explaining what it does, instead only throwing words here and there "Key value", "pub-sub", "microservices can live anywhere" And? Why do I care? What does "microservices can live anywhere" even mean and what does it have to do with NATS? I find RabbitMQ sometimes inscrutable but I think even their website is better