John Weldon

NATS & Distributed Systems

Articles on NATS messaging, JetStream, and distributed systems operations.


Per-Region Service Routing with NATS Subject Mappings

Apps publish to one subject everywhere. Server-side subject mappings, scoped per cluster in a super-cluster, route to the active regional service without application changes.

Why Your JetStream Handler Runs Twice

JetStream message redelivery is not a bug -- but the AckWait and MaxAckPending defaults make handlers run twice when sequential processing is slower than 30ms per message.

What Flush() Actually Does in NATS

NATS Flush is not what you think -- it's a PING/PONG round-trip that confirms the server parsed everything you sent, not a local buffer dump.

Recovering a JetStream Cluster After Quorum Loss

A step-by-step guide to recognizing and recovering from JetStream quorum loss, including the nats-server 2.12 change that broke the old scale-up workaround.

Why NATS SubscribeSync Uses 512KB Per Subscription

A customer reported NATS using ~100x more memory per subscription than Redis. They were right -- and it's by design.

How NATS Lame Duck Mode Actually Works

The protocol coordination behind zero-downtime NATS server restarts: how SIGUSR2 triggers a multi-phase shutdown that hands clients off without dropping traffic.

Designing NATS Subject Schemas

Subject design is the first decision in a NATS deployment and the hardest to change later. Here's how to get it right.