Hacker News new | ask | show | jobs
by beagle3 3940 days ago
A pretty fair comparison, I think.

NATS requires a broker, ZeroMQ doesn't (though it generally supports a "forwarding device", which -- in the absence of transactional semantics as it is in NATS -- is mostly indistinguishable from a broker).

From the user's perspective, ZeroMQ provides a superset of the functionality, and a superset of the topologies. Why would you say the comparison is unfair?

1 comments

A latency/throughput benchmark comparing the two is effectively comparing the latency/throughput of a socket from A to B. The same benchmark for NATS would be a socket from A to NATS and NATS to B. Obviously the latency of going over the wire once is going to be lower than going over the wire twice.

A proper comparison would need to include the forwarding device for ZeroMQ.

Not at all. It is an internal implementation detail that, in almost all relevant topologies, ZeroMQ can do with just one socket connection but NATS needs two. Furthermore, in LAN pub/sub topologies, ZeroMQ can do with just one copy of the message on the outgoing wire + the occasional retransmit (letting the switch handle the broadcast/multicast) whereas NATS requires a copy for every subscriber.

> Obviously the latency of going over the wire once is going to be lower than going over the wire twice.

Latencywise, and all things being optimal, yes. But not all things are optimal.

Throughputwise, and all things being optimal, there shouldn't be any difference. But there is a huge one on both receive and transmit.

NATS and ZeroMQ are obviously not equivalent, but I maintain that this is an apples-to-apples proper and useful comparison, even without the forwarding device.