Readit News logoReadit News
CharlieDigital · 2 years ago
Back in 2014, I was rebuilding the core of an event processing engine. At the time, the decision was between Apache Kafka and rolling our own. After investigating Zookeeper, we decided to roll our own and chose ZeroMQ as the messaging layer as our on-prem customers probably didn't want to own and manage Zookeeper.

ZeroMQ was absolutely solid and stable; incredibly trouble free and the only issues we ran into were when IT teams didn't open the ports we documented in the configuration procedure. (The resultant architecture actually looks a lot like Flink)

In any case, ZeroMQ is a fantastic piece of technology that I feel like I don't see out in the wild quite enough. It's dead simple and incredibly stable from my experience.

throwaway9870 · 2 years ago
The problem is that it started out as any but stable and reliable. It asserted on received data, which in a network application is a super newbie mistake. When I looked at it, the pub/sub socket would hang forever if the other end interrupted the connection. So the zeromq guide which said "look how easy it is" was only true if you ignored errors. If you are writing network code and ignore errors, well, good luck. That was a long time ago (~10yrs) so if it is better now, good for them. Also, both founders have left the project. One passed from cancer, the other didn't like what he built and started over in C. Not that they can't be replaced, but transitions can be hard and take time.
chomp · 2 years ago
> When I looked at it, the pub/sub socket would hang forever if the other end interrupted the connection.

You just gave me openstack+zeromq flashbacks

jvanderbot · 2 years ago
Yes - nanomsg / nng are quite good. I think / believe they'll be part and parcel for some space missions soon enough.
victor106 · 2 years ago
> It asserted on received data, which in a network application is a super newbie mistake

What do mature network applications do instead?

kabes · 2 years ago
In a company I work for they decided to do the same, around the same time. I believe it was a wrong call. Over time requirements have grown and we ended up bolting all kinds of kafka features on top of the zeromq thing, but of course much crappier. And in the meantime kafka doesn't require zookeeper anymore and is the de-facto standard
CharlieDigital · 2 years ago
Of course, ZeroMQ and Kafka are two very different tools that serve different purposes and one needs to understand the tradeoffs.

For us, delivering an on-prem commercial off the shelf solution, it was untenable to expect the customer IT team to operate a separate, relatively huge piece of tech (remember, this is 2014). Maybe the heuristics would be different today with K8s and advancement of Kafka. But ZeroMQ as an in-process, distributed messaging layer is dead simple. If your use case requires anything else on top of that, it's on the team to design the right solution like resiliency, statefulness, etc.

For a high throughput, distributed compute focused use case, I think ZMQ is still a great choice for coordinating execution. But Kafka and other options on the market now are great choices for higher order abstractions.

castlecrasher2 · 2 years ago
A company I worked for had the same problem. Messages were being dropped, and either no one on backend knew how or wanted to investigate. I was on the data team and we just had to deal with it.
perbu · 2 years ago
It's also quite fast.

I remember we had a similar use-case. This was for collecting live statistics from a sizable Varnish Cache cluster. We wrote a in memory database to store the data. It's been chugging away for about 10 years now and last I heard the zmq traffic alone was about 3Gbps with zero issues.

ksimukka · 2 years ago
Aside from some scaling issues, it still is a great solution for having real-time insight into the performance of Varnish and the cache.

We even went as far as writing a Golang version of the VCS server to better handle some of the scaling challenges. I don’t remember the exact library that we are using to call into ZeroMQ, but the CGO overhead was minimal.

formerly_proven · 2 years ago
> It's also quite fast.

IIRC it does all I/O on separate background threads which means every operation actually goes through an inter-thread queue. Which can be good and bad.

vxxzy · 2 years ago
If you look close at the neuralink demo you’ll notice they use zeromq. I suspect the flexibility and the reduced latency makes a difference.
cmrdporcupine · 2 years ago
The problem with ZeroMQ is that it is highly opinionated about threading and concurrency in a way that doesn't necessarily mesh well with other components of your application stack that have their own opinions

http://wiki.zeromq.org/blog:multithreading-magic

There's nothing wrong with the opinions presented there -- but it really wants to own your whole threading / serving stack, and isn't really compatible with e.g. a Rust async tokio binary where threads can "move around" etc.

wallstprog · 2 years ago
Well, the original non-thread-safe sockets (e.g., ZMQ_SUB, etc.) were that way because they support multi-part messages. And yes, the fact that they are not thread-safe is a bit of a stumbling-block for ZeroMQ newbies (including me, back in the day).

However, it's not that hard to work around their non-thread-safe nature with a single dispatch thread (e.g., see <https://github.com/nyfix/OZ/blob/master/src/transport.c#L457>), and that approach has other potential benefits.

In any case, newer socket types (e.g., ZMQ_CLIENT) have since been defined that are thread-safe, but necessarily don't support multi-part messages. (They tend to be different in other ways as well -- e.g., ZMQ_RADIO/ZMQ_DISH are "sort of" replacements for the original ZMQ_PUB/ZMQ_SUB sockets, but have other constraints as well).

wallstprog · 2 years ago
At my day job we run > 50 million messages per day through ZeroMQ, and have been quite pleased with its performance and stability (https://github.com/nyfix/OZ/tree/master#who-uses-it).

But the truth is that ZeroMQ has a steep learning curve, and some rather sharp edges that can leave nasty cuts if one is not careful.

If you're interested in becoming familiar with ZeroMQ, you might want to check out our implementation: <https://github.com/nyfix/OZ/>.

flyinghamster · 2 years ago
If you have played around with GNU Radio, ZeroMQ is baked-in for communications with outside applications. I've played with it a bit, and found it to be very much fire-and-forget once you have it set up properly.
talent_deprived · 2 years ago
That's cool, I've played with GNU Radio some, wasn't aware it used ZeroMQ, actually, I've used several *MQ's but not ZeroMQ, guess I should look into it more.
giovannibonetti · 2 years ago
I wonder if this is one of those problems Erlang and the Beam VM solve out of the box. Native clustering, message passing from one node to the other, no need for a separate dependency... That's the same design, isn't it?

Disclaimer: I don't work with any of that tech right now, but I'm looking forward to working with Elixir, which is in the same ecosystem.

dist-epoch · 2 years ago
NATS is today's ZeroMQ, even easier and more reliable.
CharlieDigital · 2 years ago
Is it? ZeroMQ runs in-process as a library. NATS looks like it requires a server.

Deleted Comment

dsterry · 2 years ago
Found Pieter and his books a couple years ago and it make a big impact. The Collective Code Construction Contract is a brilliant piece of community engineering and should be adopted/adapted by every FOSS project on the planet. We can accomplish so much more together if we have C4 and similar methods of coordination. Next time you hear of a burnt-out maintainer, have them read https://rfc.zeromq.org/spec/42/
cobertos · 2 years ago
Is it very common to contact _every_ maintainer and back out changes from ones who don't respond for license changes?

I feel like I've heard of many larger companies doing relicenses on their open source without this kind of effort.

taway1237 · 2 years ago
They legally have to ask every contributor. The exception/loophole used by big companies (but also FSF for example) is that every contributor had to sign a CLA where they legally reassign ownership of their code to the project owner.
sneak · 2 years ago
This is why you should never sign a CLA; it allows later relicensing of your work to nonfree licenses.

Linux doesn’t have a CLA, and it’s the most popular operating system in the world.

dagmx · 2 years ago
CLA’s don’t fully transfer ownership (hence the L) and don’t unilaterally allow changing the software license. Though that does of course depend on the nature of each CLA since there’s no singular contract associated.

A CTA (transfer vs license) does allow unilateral license changes after the fact.

Zambyte · 2 years ago
The FSF has been (slowly) moving away from CLAs though [0]

[0] https://heathermeeker.com/2021/06/01/fsf-drops-assignment-re...

jen20 · 2 years ago
The other "loophole" is not to relicense, but instead for a corporation to make their own future contributions with a different license. This doesn't work too well from GPL-like licenses, but is fine for file-based copyleft.
hwc · 2 years ago
Could one have a kind of CLA where a contributor licenses their work under ANY license that meets the open source definition?
diggan · 2 years ago
People contacted were people who made major modifications, not every single contributor. And yeah, if the contributor don't agree to the new license, you can either don't do the license change, or remove the code they wrote as they don't agree to the new license.

There is more background here: https://github.com/zeromq/libzmq/issues/2376

Sometimes companies who do "FOSS" make you sign some sort of agreement that they own the code you produce and you won't have any say about re-licensing, so maybe the projects you're thinking about have done that?

LadyCailin · 2 years ago
IANAL, but if the license isn’t materially compatible (which perhaps is the case for LGPL and MPL, I don’t know MPL enough to say), I would imagine this is the only legal way to do it. When I contribute to a project, I release my code on the agreed upon license. You can’t change that without my permission.
dagmx · 2 years ago
Yes very common. I’ve helped some projects relicense in the past (because the original developer didn’t actually understand the license they chose) and it’s arduous having to contact each individual (and sometimes companies) to relicense.

You can do license changes without that however as long as:

1. You license per file in the repository. This can be quite arduous but many projects will move the old licensed stuff into a sub project to make that easier to grok.

2. Your new license is compatible with the old license.

cwp · 2 years ago
Yeah. This is how Squeak changed the license from SqueakL to Apache and MIT. That code has a lot of history, so it was a pretty big effort, but worth it in the end.

Deleted Comment

vitiral · 2 years ago
That is damn impressive considering the age of the project. Kudos for getting signoff from all relevant parties!
richardfontana · 2 years ago
The LGPLv3 exception had an atypical feature (for *GPL exceptions) and was possibly misdrafted, see: https://github.com/spdx/license-list-XML/issues/1672
chromatin · 2 years ago
Fun ZeroMQ fact: bitcoind has used zeromq since 2015. This is used by client software including lightning node daemons to get notification of incoming transactions and blocks in a highly reliable and rapid way.

https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md

excerionsforte · 2 years ago
Also 4.3.5 is out today with the new license: https://github.com/zeromq/libzmq/releases/tag/v4.3.5
oarfish · 2 years ago
Remarkable, up until recently, requests for a new release were somewhat brusquely rejected and marked as spam. e.g.

https://github.com/zeromq/libzmq/issues/4315 and https://github.com/zeromq/libzmq/issues/4455

I wonder what made the maintainer change his mind.

wngr · 2 years ago
Issues have been deleted in the meantime ..
isoprophlex · 2 years ago
O wow! It's been a while since the last release, in the back of my mind I had the idea that the project was slowly dying because of Pieter Hintjes' untimely demise... good to see it's still kicking. Very solid software, an absolute joy to work with.
jen20 · 2 years ago
Related: The ZeroMQ guide (published by O'Reilly, but available online at [1]) is one of the finest pieces of technical writing in existence.

[1]: https://zguide.zeromq.org

sdfghswe · 2 years ago
Could someone who understands these licenses ELI5?
CJefferson · 2 years ago
The main difference is the LGPL works at the “library” level, and requires the source for the library is open source. It requires in particular you can replace the library, which means you can’t really static link to it from a closed source program (or open source but LGPL incompatible license).

MPL works on the “source file” level. You have to release any changes you make to MPL licensed files, but you can link those files into a closed source program any way you like.

mrweasel · 2 years ago
So I could compile a program, dynamically link an LGPL library and that's fine, but the moment I statically link the same program I'd be violating the LGPL. I never considered that, don't that make the LGPL a pretty poor license for pretty much anything?
michaelsbradley · 2 years ago
> which means you can’t really static link to it from a closed source program

Incorrect.

https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynami...

   If you statically link against an LGPLed library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.

goodpoint · 2 years ago
> you can’t really static link to it from a closed source program

This is false. You can static link as long as you follow https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynami...

Additionally, LGPL3 can be tweaked to add an exception to allow unrestricted static linking. This is like... exactly what ZeroMQ did.

jacquesm · 2 years ago
Improved interop with other open source programs because they used to have a 'one off' license. That makes using ZeroMQ harder than it should be because there is always the question of whether or not their license is more or less permissive than the one that you've picked for your project and risks future unintended side effects. This move should lay that all to rest.
bluGill · 2 years ago
Lawyers have mostly looked at the common open source licenses long enough to know what they say: what is compatible with each other, what is compatible with their [corporate/clients] other needs, and otherwise how it works. While mostly they have not been tested in court, there general consensus they will hold up somehow (nobody knows for sure and there are a couple hundred countries that could each decide their own thing).

When you do your own license though lawyers need to figure everything out for just your project.