Skip to content

Limits

Outcome: the honest edges of NATS, stated before they surprise you — what the core will not do, what one server's JetStream is worth, and where the design points you elsewhere.

The core forgets — by design, and completely

  • No store, no replay, no "last message". A core subscriber that connects late has missed the past, full stop (chapter 4). There is no core equivalent of MQTT's retained message; if latecomers need the current state, publish it on a schedule, answer for it by request/reply, or keep it in the key-value store — three honest patterns, all in this guide.
  • No delivery guarantee to queue members. A queue group's chosen member crashing mid-job loses the job (chapter 7). The guarantee ladder is climbed by changing tools, not flags: core → queue group → JetStream consumer with acknowledgements.
  • Slow consumers are shed. A subscriber that cannot keep up is eventually disconnected rather than allowed to back the server up — the server protects the many from the one. Watch for it in the server log if a client "randomly" drops under load.

Size and shape

  • 1 MB maximum message by default, read off the lab server's own /varz page (t01). It can be raised in config; raising it much is usually a design smell. Files go through the object store in chunks (chapter 9), not through heroic payloads.
  • Subjects are the only routing. No content-based filtering, no message transformation in the server, no routing rules language. If the server must decide things about messages, you are describing RabbitMQ's exchanges (chapter 12) or an application program of your own subscribed in the middle.
  • Bodies are opaque bytes. No schema, no validation, no agreed types beyond what your programs agree between themselves. Freedom and hazard in one line.

One server's JetStream

  • The lab ran one replica, on one disk. Its restart proof (t09) shows files survive a process restart. A dead disk is a different event: clustered JetStream with 3 replicas is the documented answer, and it needs the cluster this lab did not have. Do not let the word "JetStream" alone sell you durability your topology does not have.
  • Storage is a budget, enforced by your settings. Limits, max age, max bytes, discard policy — a stream with none set grows until the disk files a complaint of its own. The work-queue and interest retention policies (chapter 8 promised them their sentence): interest keeps a message only while some consumer is interested in it, and work-queue deletes each message once it is acknowledged — both documented here, neither run in the lab.
  • Redelivery is not resurrection. Past a consumer's max-deliver cap, an unacknowledged message stops being offered. What then — an operator's inspection, a dead-letter subject of your own design — is your system's decision to make in advance, not the server's.

Operational honesty

  • The headline speed is the loopback speed. Chapter 10's ~190,000 messages/second was one machine, shared with other work, tiny messages, core (unstored) path. Real networks, real sizes and JetStream's disk each take their share. The number proves "not the bottleneck for a small system", nothing more.
  • Security beyond chapter 10 exists and is its own subject. Accounts, operators, JWT credentials, TLS everywhere, cluster authorisation — the machinery of hosted, multi-tenant NATS — is deliberately out of this guide's scope (see the README). A server reachable from the internet deserves that machinery or a firewall in front of it, not merely a token.
  • Ordering is per-stream-of-traffic, not global. Messages from one publisher on one subject arrive in order; the interleaving of two publishers is the order the server received them, which is all anyone can honestly promise.

Check: name the rung of the delivery ladder each of your uses sits on — announced, shared, or acknowledged. Anything sitting a rung below its consequences is a limit already costing you; it just has not sent the bill yet.