zlacker

[parent] [thread] 0 comments
1. paulgb+(OP)[view] [source] 2023-07-23 19:57:46
MQTT is a protocol rather than an alternative to NATS; NATS supports MQTT (https://docs.nats.io/running-a-nats-service/configuration/mq...)

As far as ideal use cases, we use NATS for https://plane.dev in two ways:

- As a message bus, it is a layer of abstraction on top of the network. Instead of each node needing to establish a connection to every node it needs to connect to, it just connects to a NATS cluster and messages are routed by subject. This is great for debugging because we can "wiretap" messages on a given subject pattern and verify what's being sent. We even have a service that listens on NATS subjects and conditionally turns events into Slack messages.

- It has a built-in RAFT implementation (via JetStream), which we piggyback on when we need to create consensus among nodes.

[go to top]