Lesson 13 · Senior NATS practice
Subject design, wildcard boundaries, and event taxonomy
How to think about subject naming, wildcard capture, event family boundaries, and the long-term cost of messy event taxonomies.
Your win: explain why subject design is not just naming style, and how wildcard scope, stream capture, and event-family boundaries shape long-term fan-out and replay behavior.
Why this page matters more than it first looks
At first, subject naming feels like a low-stakes concern. You pick words, add dots, maybe use a wildcard, and move on. That is the beginner reading. The senior reading starts when you realize those names become part of the system’s long-term structure.
In NATS, subject families affect who can subscribe, what a stream captures, what a wildcard accidentally sweeps in, how replay gets scoped, and how easy it is to explain ownership to the next engineer. That is why this lesson is really about architecture wearing a naming costume.
Why wildcard boundaries deserve more respect
Wildcards feel convenient because they let one stream or consumer cover a whole event family at once. That convenience is real. The problem is that wildcards quietly create grouping decisions that may live for a long time.
If a wildcard family grows too broad, unrelated events start sharing retention assumptions, ownership assumptions, replay assumptions, and sometimes access assumptions. Once that happens, the system still “works,” but it gets harder to reason about. That is the kind of hidden coupling senior engineers are trained to notice.
So the question is not only “does this wildcard match the events I need?” The better question is “should these events really belong to the same family at all?”
User.* or Notification.*, then consumers narrow back to concrete subjects. The real design judgment is deciding where that family boundary belongs.
Revisit subjects with a design lens
Go back to the official subject and wildcard docs, then compare them with the repo’s centralized constants and stream definitions.
Check yourself (from memory)
Q1. What is the most senior way to think about subject taxonomy?
Sources. Official NATS subjects docs; repo NATS map.