New Examples - NATS Cluster and 6PN Demo Chat

In our ongoing quest to show all the neat things you can do with Fly, here’s a peep at two new examples that go together. First, there’s a new NATS cluster example which leverages Fly’s 6PN .internal DNS to locate other servers in the cluster. And if you don’t have a NATS app to try that out with, we have 6PN-Demo-Chat, a web sockets based chat which relays messages through NATS for global reach. It also uses the 6PN DNS to locate the cluster. Enjoy and let us know how you get on!

We are planning to use NATS for better log monitoring in flyctl down the road. It’s silly easy to install, and the way the subscriptions work makes it immediately responsive (you get messages from the nearest publishers very quickly) and easy to scale (if there’s no subscriber, publishing on a channel is basically a no-op).

For our purposes, this means running NATS nodes in each region and publishing log messages into app:<app-name> topics. When someone does flyctl logs, we will subscribe them to an app:<app-name> channel. That subscription gets gossiped around, so the regions that own an app’s VMs will start shipping messages over.

This is cleaner and simpler than what we’re currently doing, which is shipping all logs to a big ol’ Elasticsearch cluster, and then polling through our GraphQL API.

That sounds really clean, playing to strengths for both NATS and Fly. Is Fly hiring, btw? Projects like this ought to fun to work on.

We aren’t yet! We should be hiring for a developer experience role soon, we’ll post here when we do (and on Hacker News).

1 Like