NATS + NATS Streaming...simultaneously?

153 views
Skip to first unread message

Ryan Riddel

unread,
Oct 3, 2017, 8:07:14 PM10/3/17
to nats
I have business needs that neither NATS core nor NATS streaming alone can satisfy, but that both do.  I read that NATS Streaming uses the NATS core for sending messages, and that NATS streaming clients will not receive messages published to a subject by non-streaming clients.

Can both NATS and NATS Streaming clients use the same message bus (on the same ports)?  If so, wouldn't this imply that NATS Streaming does support clustering, when the documentation says it doesnt?

Colin Sullivan

unread,
Oct 4, 2017, 11:34:04 AM10/4/17
to nats
Ryan,

Yes and no...   Thanks for asking this question.

First, you are correct; NATS streaming subjects are separate from NATS subjects, and a NATS streaming client will not receive core NATS client messages.  

Architecturally, it may be helpful to think of NATS streaming as a layer on top core NATS, with the NATS streaming server being a core NATS client under the hood.    A NATS streaming server by default runs an embedded NATS core server for ease of use and convenience (although it can be launched stand-alone too).  Given this architecture, there is nothing stopping core NATS clients from operating alongside NATS streaming, using the same (embedded) NATS server.  When doing this, you'll want to be aware of your subject namespace - if you wildcard subscribe in a core NATS client ">", you'll receive NATS streaming messages that won't be useful to your core NATS client.

In discussing clustering, there are two forms:  Core NATS, and NATS streaming.   Core NATS clustering is distinct from the upcoming NATS streaming clustering.
  • Core NATS clustering exists today, and provides scalability and high availability for all core NATS clients, but does not share any server state.
  • NATS streaming clustering work is underway, and will replicate streaming data to provide HA and fault tolerance (beyond the mechanisms we already provide).  This is clustering amongst NATS streaming servers, separate from core NATS clustering, and only applies to NATS streaming.
We're aware there is some confusion here and will work to making this clearer in our documentation.  Does this help?

Colin Sullivan

unread,
Oct 4, 2017, 11:39:20 AM10/4/17
to nats
To summarize:  NATS and NATS streaming can use the same servers (bus/ports), but clustering will be different between NATS streaming servers and core NATS servers.

Ryan Riddel

unread,
Oct 5, 2017, 1:30:06 PM10/5/17
to nat...@googlegroups.com
It does Colin, thanks for taking the time to answer. That makes sense, though I suppose one does t truly know how it will work until he tries. Im going to be getting NATS hooked up on our infrastructure in the coming weeks, I will report my results.

--
You received this message because you are subscribed to a topic in the Google Groups "nats" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/natsio/m57GX74mA8o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to natsio+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Colin Sullivan

unread,
Oct 5, 2017, 2:54:14 PM10/5/17
to nats
Absolutely, happy to help.  Please do let us know how it goes!
To unsubscribe from this group and all its topics, send an email to natsio+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages