14 ms·
This looks pretty cool, and makes me sad that Mongrel2 never became popular. In short: Mongrel2 solves the same problem, but does it by letting your application
by skrebbel 9y ago
This looks pretty cool, and makes me sad that Mongrel2 never became popular. In short: Mongrel2 solves the same problem, but does it by letting your application handle requests and websocket connections over ZeroMQ instead of eg FastCGI.
I guess it lost momentum when ZeroMQ did. Anyone know why? Sounds like a dream solution in the current microservice hype.
http://mongrel2.org/ http://mongrel2.org/
- coldtea 9y agoMongrel2 was indeed a nice idea on paper. It never had much momentum though -- but what it lost and killed it was Zed's interest.
- agnivade 9y agoWait, zeromq lost momentum ? When did that happen ?
- FooBarWidget 9y agoWhen was the last time you heard something about it?
- RantyDave 9y agoI'm using it for a project now. It's a bit weird, but it does work. Cool thing: you can slot a file descriptor into the zmq provided poll ... point is that you can poll on both zmq and sockets in the one loop. Pro Tip: Use 'cbor' for serialising.
- sevensor 9y ago> you can poll on both zmq and sockets in the one loop Which is magnificent. The ZMQ poller is tons of fun. (Although I think this doesn't work on Windows.)
- shoover 9y agoThanks for the tip. In which language(s) do you use CBOR? I want to like it, but the various C APIs look a bit cumbersome and lacking docs.
- RantyDave 9y agoPython 3.
- jeremyjh 9y agoWhen was the last time you heard something about zlib? At a certain point - libraries are basically done. They are widely distributed, everyone knows what they are, there is no reason to talk about them but they are still maintained and heavily used.
- sametmax 9y agoThis morning when I used it. I don't use zmq nearly has much.
- FooBarWidget 9y agoLibraries can be done, but that has got nothing to do with momentum. Momentum depends on mindshare, on the willingness of people to use and to keep using it. Most programmers don't choose technology based purely on merits, they choose it based on "I heard X talk about Y and s/he said good things, so I guess I'll use it". We programmers aren't as rational as we think.
- sanderjd 9y agoLike it or not, popularity and momentum are important merits of a technology. They lead to all sorts of benefits, like healthy maintenance and further development, better documentation, and support when you run into trouble. It is rational to consider these things when choosing technology.
- theshrike79 9y agoDunno, I spent close to a week trying to get it to compile with and without encryption on Windows to no avail. Ended up using a Linux container on Docker to get the thing working.
- shoover 9y agoThat is troubling. I always thought of zeromq as having as good Windows support as anything not written exclusively for Windows.
- theshrike79 9y agoSo did I, that's why I selected it. Did my development on OSX and Linux and thought that deploying a static binary on Windows would be a breeze. It wasn't, turned out to be a Class 4 hurricane :P
- shoover 9y agoLooks like there is a path hardcoded in the build files causing problems. After some reflection on the msvc/README, renaming the project directory to libzmq (was: zeromq-4.2.2 from the release or libzmq-master from github zip download), and launching cmd.exe using the Developer Command Prompt for VS2015 link, libzmq/builds/msvc/build/build.bat successfully builds all configurations.
- dec0dedab0de 9y agoI think it happened in 2012 when this came out http://250bpm.com/blog:4 http://250bpm.com/blog:4 Before that, I used to hear people talking about it all the time.
- ivoras 9y agoCool article! I guess that's why Go does its error handling without exceptions.
- rch 9y agoIt has the same momentum, but too much mass and not enough velocity.
- pkulak 9y agoZing!
- adrianratnapala 9y agoIn which direction do you want it do move, if you want velocity that is. I more often find platforms have too much velocity. And if not too little mass, then too little solidity.
- riquito 9y agoWhen the main developer decided that it wasn't good enough and started working on nanomsg (http://nanomsg.org/ http://nanomsg.org/)
- agnivade 9y agozeromq is still very much in wide use. nanomsg doesn't have nearly as much documentation and community support as zeromq does.
- tlb 9y agoI recently switched from zeromq to straight libuv sockets with jsonl (\n-separated json) payloads. Because I'm working inside a Node process, combining zmq's threading model with Node's threading model was a pain. Now, there's a single IO thread which is the same as the Javascript engine thread, and I can use uv_work to run CPU-intensive tasks on multiple cores.
- Matthias247 9y agoDo you not allow \n inside your JSON or encode your JSON as base64? If not you might have problems with disambiguating frame ends from line breaks inside frames. A common way for framing is to prepend each frame with it's encoded length. That's easier, faster and less error-prone than searching for ASCII delimeters.
- AgentME 9y agoIf you do the JSON serialization yourself, there's no reason for newlines to be in the JSON. (Newlines within strings are encoded as \n.)
- deleted 9y ago[deleted]
- justinsaccount 9y agoa newline is encoded as the two characters "\n" in json and would not be confused with a literal \n (aka \x0a) character
- dungle6 9y agoErm...JSON allows whitespace last I checked. \n (ie the actual \x0a) is a whitespace character, and so can appear as a discarded token in JSON. So you would basically have to restrict to a subset of JSON -- it's not actually JSON anymore at that point.
- tlb 9y ago
- sixdimensional 9y agoUnfortunately, the founder of ZeroMQ, Pieter Hintjens passed away (due to cancer) [1]. He was a regular on HN [2]. ZeroMQ still works great and the open source community is still maintaining it on GitHub [3]. I just think people are also looking at other technologies. A lot of interest popped up in things like Apache Kafka and Samsa. I still think ZeroMQ holds a unique place due to its lightweight and simple nature. [1] https://news.ycombinator.com/item?id=11547212 https://news.ycombinator.com/item?id=11547212 [2] https://news.ycombinator.com/user?id=PieterH https://news.ycombinator.com/user?id=PieterH [3] https://github.com/zeromq https://github.com/zeromq
- agnivade 9y agoYes, I am aware that Peter had passed away. I thought that it was implied that the project is not maintained anymore, which is not true.
- shoover 9y agoI have been curious how the community would hold up after Pieter's death. This project is a unique case because of how much work went into building community and welcoming contributions. That said, the world is a different place than in zeromq's heyday. Other commenters refer to Martin leaving the project, C++ regret, and a poor fit with node.js. Maybe in the face of all those changes zeromq's mature community is primarily why it lives as a project.
- justonepost 9y agomicroservices on their face seem cool, but in reality not so much. really, it's just SOA taken to an unnecessary extreme.
- foo4u 9y agoIt's really SOA without the XML based service bus.
- agentgt 9y agoOh the "service bus" <strike>xml</strike> json is coming back... its called lambda architecture. And again nothing new except someone else takes care of some server software for you with the promise of reduced price and maintenance but the reality eventually becomes tight proprietary coupling and eventual price gauging.
- derefr 9y agoAmazon's own Lambda is that, yes. But the Lambda architecture it inspired is the opposite: a de-facto standard (based on the way Amazon's works, but probably eventually an open standard) for servers any org can use to stand up their own public or private FaaS cloud, which developers can deploy Lambda functions onto rather than having to build an entire container/VM just to slot it into OpenStack.
- edgan 9y agoI doubt it will ever be a standard. Amazon loves vendor lock in. Plus most of the cloud services love to do their own thing for each service type. The main exception seems to be Kubernetes. Google has it in GCE, and Amazon has said they are working on their own Kubernetes service. If that happens, I bet Azure will follow if they aren't already working on it.
- derefr 9y agoI (and others) are not so much imagining a standard between cloud vendors, as we're imagining a standard "FaaS server function API" (sort of like how the web has a standard DOM API) supported by several FOSS FaaS server implementations (sort of like how the web has several FOSS Javascript engines.) Given such a standard API and compatible servers, you'd then deploy a FaaS server cluster to your public/private cloud of choice, the same way you deploy e.g. a Kubernetes cluster, or a Riak cluster. There would likely by small public clouds attempting to be "FaaS native" by exposing only such servers in a multitenant configuration (like small public clouds like Hyper are currently doing with CaaS.) Their implementations wouldn't always be exactly compatible, and might have some lock-in. However, once FaaS "caught on" with the enterprise, a FaaS server would likely make its way into the OpenStack architecture. At that point, you'd see medium-sized public cloud providers like OVH and DigitalOcean set up their own multitenant FaaS clusters as well, probably with custom code, but built to be compatible with the OpenStack FaaS tooling, to allow enterprises the freedom to move FaaS functions freely between public and private clouds. And, eventually, the other major cloud providers would feel the need to support the API. --- This path has already been followed: it's what happened to Amazon S3—first cloned (but not compatibly) in FOSS by tools like Riak CS; then standardized by OpenStack Swift; then cloned compatibly in FOSS by tools like Minio; then picked up by medium-scale clouds like Rackspace; and then, eventually, picked up by Azure and GCP as secondary APIs to address their equivalent offerings (that originally had quite different APIs.)
- kawsper 9y agoThat is a really cool idea, do you know of other projects like it?
- skrebbel 9y agoNginx Unit? :-)
- floatboth 9y agoYeah, Mongrel2 looked like a good idea… but turns out it's kinda pointless. Why talk to your app via HTTP-reencoded-as-ZMQ when you can just talk straight up HTTP? Pretty much all languages have very fast and concurrent HTTP servers these days.
- skrebbel 9y agoI thought it was because there's a lot about http that's overhead and/or tough to get right, which can then be delegated to the server. Also, websockets actually map pretty badly to http, conceptually, and fit zeromq much better IMO.
- goblin89 9y agoRegarding websockets (admittedly off-topic re Mongrel though), I recently found out about Pushpin[0], which seems to be an elegant way to translate WS into HTTP, should it be of interest to someone. Basically a proxy-server that takes care of accepting either websockets or HTTP on the front, and talking only HTTP on the other side. [0] http://pushpin.org http://pushpin.org
- jkarneges 9y agoPushpin uses Mongrel2 under the hood to handle incoming WebSocket connections, so not entirely off topic. :) It's pulled in as a dependency and launched in the background.
- nly 9y agoI thought PushPin was based on Qt?
- jkarneges 9y agoIt's multi-process. The core logic is a Qt application, but it delegates the external protocol I/O to separate processes. Mongrel2 handles inbound and Zurl handles outbound (Zurl is a project of ours that is basically the inverse of Mongrel2).