Live data from Hacker News

Stream Compression in NATS

qaze.app

1–10 of 24 posts

Re: Stream Compression in NATS

#4
post #3

Didn't know what NATS is, page doesn't explain it. Tried to click on the Docs link at the bottom of the page but that doesn't work. Stopped looking.

I felt the same but had more luck. I found this comparison in their docs[1]: 'NATS Comparison to Kafka, Rabbit, gRPC, and others'.

1: https://docs.nats.io/nats-concepts/overview/compare-nats

Re: Stream Compression in NATS

#5
Honestly, I'm more interested in auth callout, someone making a "how to use this stuff effectively" video and/or article, for dummies, ideally with keycloak.

If you look at [0] how does this explain anything? Seems like I need to write a service utilizing NATS which talks to the OIDC server.

NATS auth story is a complicated one, and now with auth callout it's even more complicated.

What I also quite didn't succeed in were JS client Jetstream consumers, async polling or w/e. All the examples, async or sync would block execution.

The regular request/response with microservices went well and straightforward. No issues at all. But writing middleware is also not very pretty, you have to have dedicated functions which you would call in the request handler (or microservice if you will) instead of being able to define a chain of middleware functions. Potejto potato but organization and structure and naming is half the code.

And more now you can't rely on http error codes, even if you can use them.

Then debugging is difficult, because messages are sent in binary format, and with no middleware to conditionally plug in, it's even more painful. Yeah you could write a dedicated service listening to >.* and printing deserialized JSON payloads but that's also extra work.

However dropping the HTTP overhead leads to a lot more throughput.

For now I'll stay with HTTP.

The reason I experimented with it was there is a company which required NATS knowledge.

[0] https://docs.nats.io/running-a-nats-service/configuration/se...

Re: Stream Compression in NATS

#6
post #3

Didn't know what NATS is, page doesn't explain it. Tried to click on the Docs link at the bottom of the page but that doesn't work. Stopped looking.

NATS is a server for streaming data. It can be used as a pub/sub service like Redis, but it also implements RAFT consensus so that it can be used for globally-ordered, durable streams (more like Kafka). The server itself is a lightweight Go binary and it's much nicer to manage than alternatives.

Re: Stream Compression in NATS

#7
post #3

Didn't know what NATS is, page doesn't explain it. Tried to click on the Docs link at the bottom of the page but that doesn't work. Stopped looking.

NATS is a message broker. It uses TCP or websocket, support "core" messaging aka simple fire and forget messaging, request/response, pub/sub. And then message queues, subscriptions, topics, consumers, memory and replay functionality. Also a MQTT compatible protocol.

Re: Stream Compression in NATS

#8
post #4
post #3

Didn't know what NATS is, page doesn't explain it. Tried to click on the Docs link at the bottom of the page but that doesn't work. Stopped looking.

I felt the same but had more luck. I found this comparison in their docs[1]: 'NATS Comparison to Kafka, Rabbit, gRPC, and others'. 1: https://docs.nats.io/nats-concepts/overview/compare-nats

Not sure that it makes sense to compare NATS to gRPC. Maybe the thinking is because gRPC supports bi-directional streaming? The integrations are wildly different, though.

Re: Stream Compression in NATS

#9
post #3

Didn't know what NATS is, page doesn't explain it. Tried to click on the Docs link at the bottom of the page but that doesn't work. Stopped looking.

I didn't stop looking and followed link to the version announcement, then went to the front page of nats.io from the top left of that page.

And I also still have absolutely no fucking idea what any of this is.

Re: Stream Compression in NATS

#10
post #5

Honestly, I'm more interested in auth callout, someone making a "how to use this stuff effectively" video and/or article, for dummies, ideally with keycloak. If you look at [0] how does this explain anything? Seems like I need to write a service utilizing NATS which talks to the OIDC server. NATS auth story is a complicated one, and now with auth callout it's even more complicated. What I also quite didn't succeed in…

Same. I tried out some toy use-cases using nats.js over websocket a few months ago. The prospect of possibly being able to "directly" consume messaging or key/value store from the browser with only a thin gateway between was really interesting to me but I couldn't square up the NATS-internal JWT cookie thing with how you would handle auth in a traditional web-app (OAuth client on a gateway plus a session cookie).

I found some threads saying auth callout in 2.10 would solve this and decided to table the project until 2.10 but it's really really unclear how to work through the details of converting a "traditional" OAuth access token into the NATS-specified access token required by the auth callout contract.

Post reply on HN