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.