Live data from Hacker News

NSQ – A realtime distributed messaging platform

nsq.io

21–30 of 64 posts

Re: NSQ – A realtime distributed messaging platform

#21

Previous discussion on bitly blog / reddit with some comparisons to zmq: http://www.reddit.com/r/programming/comments/117dsj/nsq_real... And also a great article that compares / contrasts NSQ along with a lot of other alternatives: http://www.bravenewgeek.com/dissecting-message-queues/

(project author)

I appreciate all the work that Tyler has put into his series of blog posts on messaging systems (and NSQ bug reports!) but I think this particular article is one that misses the mark [1].

While raw performance is important, I think comparing the guarantees and related operational and development semantics are far more interesting and useful.

These systems vary a great deal in the interfaces and functionality they expose to users building on top of them and operators dealing with them when they're deployed in production (and inevitably break!). This is ultimately what matters most.

P.S. single node (localhost) performance is essentially useless. Most of these tools are designed to be deployed as the backbone of large distributed systems (NSQ in particular), so scalability and performance in that context is a better indication of real-world performance.

[1] He's since posted this follow-up that outlines many of the same things http://www.bravenewgeek.com/benchmark-responsibly/

Re: NSQ – A realtime distributed messaging platform

#22
post #17

I'm glad these new projects are coming on, and this one seems to be very forthright about its limitations, but I'm just putting this in the bucket with all of the other messaging systems that provide a minimum feature set. I haven't seen much on the market recently that offers things like (first-class) persistence, guaranteed ordering, guaranteed delivery, or any of the other more complex distribution patterns. That'…

(project author) NSQ is as much about what it doesn't do as it is what it does. To a certain extent this mirrors, and was inspired by, the language's philosophy (Go) [1]. Also, NSQ was designed to replace an existing home-grown system deployed at scale. This dictated a lot of the initial requirements (and in certain cases excluded off-the-shelf tools). When we left the experimental phase we realized we had built some…

Yeah, don't get me wrong, it looks good for what it is, and certainly some of the best products come from skunkworks and hobby.

Is there anywhere I can read about the specific problem at bitly you built it to facilitate? I mean, I've seen a lot of these systems where there are integration and timing concerns, so some kind of message bus is useful. But if they do get to a point where things needs to be distributed, sending messages without order and delivery guarantees just seems to be passing the buck to downstream systems to not mess up.

Re: NSQ – A realtime distributed messaging platform

#23
post #22

Earlier quoted context omitted.

(project author) NSQ is as much about what it doesn't do as it is what it does. To a certain extent this mirrors, and was inspired by, the language's philosophy (Go) [1]. Also, NSQ was designed to replace an existing home-grown system deployed at scale. This dictated a lot of the initial requirements (and in certain cases excluded off-the-shelf tools). When we left the experimental phase we realized we had built some…

Yeah, don't get me wrong, it looks good for what it is, and certainly some of the best products come from skunkworks and hobby. Is there anywhere I can read about the specific problem at bitly you built it to facilitate? I mean, I've seen a lot of these systems where there are integration and timing concerns, so some kind of message bus is useful. But if they do get to a point where things needs to be distributed, se…

Yea, in the original announcement blog post (which became the design doc):

http://nsq.io/overview/design.html

Re: NSQ – A realtime distributed messaging platform

#25
post #13
post #7

How does this relate to mqtt?

MQTT is a wire protocol for connection a message sender and receiver, but leaves the actual messaging architecture (brokers, P2P, etc) unspecified. NSQ appears to include its own proprietary wire format, as well as a full im-memory messaging architecture.

Just want to add the NSQ wire format looks pretty efficient as well. Seems to be defined at the binary level which was one of the biggest wins for MQTT in terms of memory footprint. Although would be nice if a standard protocol was used instead of creating their own.

Re: NSQ – A realtime distributed messaging platform

#26
post #24

I've noticed that a lot of message queuing systems have an "delivery at least once" property. What exactly does the possibility that a message could be delivered more than once buy you?

You can have "at most once", "exactly once", or "at least once" [0]. Each has a different tradeoff in terms of implementation complexity, speed, and other availability/consistency concerns.

For different applications differently delivery QoSes are tolerable. For instance, if your messages are idempotent (either by design or nature) then "at least once" is equivalent to "exactly once" and may be much faster/easier.

Generally, "exactly once" demands the least of the application and the most of the broker.

[0] I suppose you could have "any number of times" as well, but that's no guarantee at all.

Re: NSQ – A realtime distributed messaging platform

#27
post #24

I've noticed that a lot of message queuing systems have an "delivery at least once" property. What exactly does the possibility that a message could be delivered more than once buy you?

You save the bookkeeping of "exactly once" and worrying about what happens when a node has been sent a message but not acked it.

Re: NSQ – A realtime distributed messaging platform

#28
post #24

I've noticed that a lot of message queuing systems have an "delivery at least once" property. What exactly does the possibility that a message could be delivered more than once buy you?

It's not that anyone benefits from having the message delivered more than once at the application level; actually, it's the opposite. The note that messages may be delivered more than once is a warning to developers who might expect exactly-once semantics.

However, it is a benefit in that allowing for more-than-once-delivery affords better performance. Think of it from an algorithmic perspective: if you want to send a message exactly once, you have to wait around for acknowledgement that your message was accepted.

If you instead don't mind sending duplicates, you can fire off the first copy, wait for an ack for a while, and then fire off again to another node (in case, perhaps, there was a network partition). If it turns out that both copies arrive at their final destination intact, your application now has to deal with duplicates. But, that's faster than the alternative.

So it puts more burden on the developer to deduplicate where necessary (or program in a model where duplicates don't matter anyway, such as with CRDTS), in exchange for greater throughput.

Re: NSQ – A realtime distributed messaging platform

#29
post #2

We are using NSQ at Hailo for sending and receiving billions of messages every day. It scales incredibly well and is extremely reliable. We'd be happy to speak more about this with anyone who's interested.

Can one use NSQ as a replacement for Kafka?

At Uken Studios we use NSQ as a chain of queues for log processing.

  rails -> fluentd -> NSQ (firehose) -> log splitter (python script) -> NSQ (elasticsearch, s3, hadoop)
We have this setup live since November and processed more than 25b messages without hiccups.

Re: NSQ – A realtime distributed messaging platform

#30
Having played with NSQ off and on for the past few months, and having gone deeper with it over the past week or so in preparation for rolling out a production service, here are a few things that have really impressed me, in no particular order:

It's super easy to run. A few command line params, if that, and I've got a local nsqd running that I can develop and test against. Great for those offline coding sessions on BART.

The tools it ships with are very handy, specifically to_nsq and nsq_tail. Again, both make developing stuff really easy because I can get stuff in and out with fast, native command line tools or http. In fact, when I was first playing around I built an entire prototype based on a few simple shell scripts and the provided tools, just to see what would happen.

The nsqadmin and nsq_stat tools give you a lot of visibility into what your producers and consumers are doing, how well things are performing, who is connected to what, etc. And again, part of the distribution and very easy to run locally.

The Go producer and consumer API is clean and easy to build around, pretty well documented with a lot of examples in the NSQ apps themselves.

So far very stable. I haven't seen any crashes on the server or producer/consumer side.

Helpful and friendly people on a low noise freenode channel.

Post reply on HN