Need advice about which tool to choose?Ask the StackShare community!

NSQ

140
349
+ 1
143
ZeroMQ

261
579
+ 1
71
Add tool

NSQ vs ZeroMQ: What are the differences?

Introduction

NSQ and ZeroMQ are both messaging systems that provide reliable and high-performance communication between applications. However, there are several key differences between these two systems.

  1. Messaging Model: NSQ follows a distributed publish-subscribe model, where messages are sent to a central broker and delivered to consumers based on subscription preferences. On the other hand, ZeroMQ follows a messaging patterns model, allowing various messaging patterns such as publish-subscribe, request-reply, and push-pull.

  2. Protocol: NSQ uses a custom protocol over TCP as its default transport layer protocol. It also supports HTTP for certain operations. In contrast, ZeroMQ uses its own lightweight binary messaging protocol over various transport protocols such as TCP, PGM, IPC, and in-process.

  3. Message Persistence: NSQ provides built-in message persistence by writing messages to disk, ensuring that messages are not lost even in the event of a system failure. ZeroMQ, on the other hand, does not provide built-in message persistence and relies on the application to handle message durability if needed.

  4. Scalability: NSQ is designed with scalability in mind and supports horizontal scaling by allowing the addition of multiple brokers to handle increased message throughput. ZeroMQ is designed for local inter-process communication and may require additional efforts for scaling across multiple machines.

  5. Language Support: NSQ offers client libraries that support multiple programming languages, including Go, Python, Java, and Ruby. ZeroMQ provides bindings for various programming languages, making it more versatile and accessible to developers.

  6. Advanced Features: NSQ offers advanced features such as message filtering based on topic, channel-based message distribution, and distributed message rate limiting. ZeroMQ provides advanced features such as message queuing, load balancing, and support for various messaging patterns.

In summary, NSQ and ZeroMQ differ in their messaging models, protocols, message persistence capabilities, scalability options, language support, and advanced features. These differences make each system suitable for different use cases and requirements.

Advice on NSQ and ZeroMQ
Meili Triantafyllidi
Software engineer at Digital Science · | 6 upvotes · 434.6K views
Needs advice
on
Amazon SQSAmazon SQSRabbitMQRabbitMQ
and
ZeroMQZeroMQ

Hi, we are in a ZMQ set up in a push/pull pattern, and we currently start to have more traffic and cases that the service is unavailable or stuck. We want to: * Not loose messages in services outages * Safely restart service without losing messages (ZeroMQ seems to need to close the socket in the receiver before restart manually)

Do you have experience with this setup with ZeroMQ? Would you suggest RabbitMQ or Amazon SQS (we are in AWS setup) instead? Something else?

Thank you for your time

See more
Replies (2)
Shishir Pandey
Recommends
on
RabbitMQRabbitMQ

ZeroMQ is fast but you need to build build reliability yourself. There are a number of patterns described in the zeromq guide. I have used RabbitMQ before which gives lot of functionality out of the box, you can probably use the worker queues example from the tutorial, it can also persists messages in the queue.

I haven't used Amazon SQS before. Another tool you could use is Kafka.

See more
Kevin Deyne
Principal Software Engineer at Accurate Background · | 5 upvotes · 195.1K views
Recommends
on
RabbitMQRabbitMQ

Both would do the trick, but there are some nuances. We work with both.

From the sound of it, your main focus is "not losing messages". In that case, I would go with RabbitMQ with a high availability policy (ha-mode=all) and a main/retry/error queue pattern.

Push messages to an exchange, which sends them to the main queue. If an error occurs, push the errored out message to the retry exchange, which forwards it to the retry queue. Give the retry queue a x-message-ttl and set the main exchange as a dead-letter-exchange. If your message has been retried several times, push it to the error exchange, where the message can remain until someone has time to look at it.

This is a very useful and resilient pattern that allows you to never lose messages. With the high availability policy, you make sure that if one of your rabbitmq nodes dies, another can take over and messages are already mirrored to it.

This is not really possible with SQS, because SQS is a lot more focused on throughput and scaling. Combined with SNS it can do interesting things like deduplication of messages and such. That said, one thing core to its design is that messages have a maximum retention time. The idea is that a message that has stayed in an SQS queue for a while serves no more purpose after a while, so it gets removed - so as to not block up any listener resources for a long time. You can also set up a DLQ here, but these similarly do not hold onto messages forever. Since you seem to depend on messages surviving at all cost, I would suggest that the scaling/throughput benefit of SQS does not outweigh the difference in approach to messages there.

See more
Pramod Nikam
Co Founder at Usability Designs · | 2 upvotes · 514.3K views
Needs advice
on
Apache ThriftApache ThriftKafkaKafka
and
NSQNSQ

I am looking into IoT World Solution where we have MQTT Broker. This MQTT Broker Sits in one of the Data Center. We are doing a lot of Alert and Alarm related processing on that Data, Currently, we are looking into Solution which can do distributed persistence of log/alert primarily on remote Disk.

Our primary need is to use lightweight where operational complexity and maintenance costs can be significantly reduced. We want to do it on-premise so we are not considering cloud solutions.

We looked into the following alternatives:

Apache Kafka - Great choice but operation and maintenance wise very complex. Rabbit MQ - High availability is the issue, Apache Pulsar - Operational Complexity. NATS - Absence of persistence. Akka Streams - Big learning curve and operational streams.

So we are looking into a lightweight library that can do distributed persistence preferably with publisher and subscriber model. Preferable on JVM stack.

See more
Replies (1)
Naresh Kancharla
Staff Engineer at Nutanix · | 4 upvotes · 511.7K views
Recommends
on
KafkaKafka

Kafka is best fit here. Below are the advantages with Kafka ACLs (Security), Schema (protobuf), Scale, Consumer driven and No single point of failure.

Operational complexity is manageable with open source monitoring tools.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of NSQ
Pros of ZeroMQ
  • 29
    It's in golang
  • 20
    Lightweight
  • 19
    Distributed
  • 18
    Easy setup
  • 16
    High throughput
  • 10
    Publish-Subscribe
  • 7
    Save data if no subscribers are found
  • 7
    Scalable
  • 6
    Open source
  • 5
    Temporarily kept on disk
  • 2
    Simple-to use
  • 1
    Load balanced
  • 1
    Free
  • 1
    Primarily in-memory
  • 1
    Topics and channels concept
  • 23
    Fast
  • 20
    Lightweight
  • 11
    Transport agnostic
  • 7
    No broker required
  • 4
    Low level APIs are in C
  • 4
    Low latency
  • 1
    Open source
  • 1
    Publish-Subscribe

Sign up to add or upvote prosMake informed product decisions

Cons of NSQ
Cons of ZeroMQ
  • 1
    Long term persistence
  • 1
    Get NSQ behavior out of Kafka but not inverse
  • 1
    HA
  • 5
    No message durability
  • 3
    Not a very reliable system - message delivery wise
  • 1
    M x N problem with M producers and N consumers

Sign up to add or upvote consMake informed product decisions

- No public GitHub repository available -

What is NSQ?

NSQ is a realtime distributed messaging platform designed to operate at scale, handling billions of messages per day. It promotes distributed and decentralized topologies without single points of failure, enabling fault tolerance and high availability coupled with a reliable message delivery guarantee. See features & guarantees.

What is ZeroMQ?

The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. 0MQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more.

Need advice about which tool to choose?Ask the StackShare community!

What companies use NSQ?
What companies use ZeroMQ?
See which teams inside your own company are using NSQ or ZeroMQ.
Sign up for StackShare EnterpriseLearn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with NSQ?
What tools integrate with ZeroMQ?
What are some alternatives to NSQ and ZeroMQ?
RabbitMQ
RabbitMQ gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
Kafka
Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system, but with a unique design.
Redis
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.
NATS
Unlike traditional enterprise messaging systems, NATS has an always-on dial tone that does whatever it takes to remain available. This forms a great base for building modern, reliable, and scalable cloud and distributed systems.
gRPC
gRPC is a modern open source high performance RPC framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking...
See all alternatives