-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distributed Flows / Nanomsg #8
Comments
Hi Richard! I think the surveyor pattern is quite doable in Msgflo. In fact we use something quite similar for analyzing images at The Grid, each of the different computer vision algorithms is its own "respondent". It is in NoFlo, but the principle is the same for MsgFlo, and in terms of scalability indeed it actually a better fit for the distributed/multi-process nature of Msgflo - we just didn't have it when we initially built it! One possible implementation is a unidirectional data flow, where sending out the survey and collecting the results is done by two different participants. In .FBP DSL it would look something like this:
The The questions are (as usual) how to do syncronization and decide "when are we done?". We're assuming that we have a static number of respondents (N=3). Then you can let each If you want timeout handling, then need an additional connection |
A completed graph could be like this
|
Regarding NanoMsg: msgflo-cpp supports getting the binary data from the AMQP/MQTT message. So as long as the participants on each side agree, you can use whatever you want, including NanoMsg. |
Hope this answers your questions! |
I see now that nanomsg also has pubsub facilities and so on. In order to use this with msgflo one would have to have a nanomsg-powered broker (to replace mosquitto/rabbitmq) and then teach msgflo to use it to bind the topics/queues of participants together. Definitely possible, but unless there is a particular need to use nanomsg, I'd recommend going with AMQP, at least initially. |
Hi @jonnor, Hope you are all well ! Thanks for this detailed reply and many apologies for my late reply ! Questions:- noflo/msgflow/flowhub as an API Gateway The closest flow, towards my little backend project, golang based, rather than nodejs for better QPS expectation, and load-balancing strategy with Vulcand, is the one proposed by Krakend in the picture below.
So, I spotted some pull requests from Syntace bridging goflow and noflo-ui. Would it better to combine goflow, Krakend, go-mangos and administrate service trees with noflo-ui to get a kind of elastic service gateway ? or to use msgflo-cpp + noflo-ui, as a relay to all incoming requests ? - Noflo-ui
- Docker related/demos:
Hope I was clear about the global intent with my project; it is all about a distributed requests pipeline manager with an aggregation gateway api. Cheers, |
As far as I understand, node-red is a combination of a dataflow runtime, and a UI for programming it. It only supports Node.js. cascades is not a UI, and thus is not comparable with noflo-ui - but more with Msgflo (both support multiple languages and communicate over network). The project does not seem to be updated for about 2 years, which is not so good. The main architectural difference that I see is that Msgflo uses a message broker, like RabbitMQ. These are battle tested and have many good features like persistence, clustering, authentication and so on. |
Not that I am aware of. We might create such an image in the future. |
Of course. NoFlo is a regular Node.js library, so you can use any Node.js/NPM tools for this. |
I have not developed API gateways before, so there is a limit to how specific advice I can give. But I |
If you can, avoid doing heavy computation like images in a syncronous HTTP request-response. Instead have a system where one request creates an image processing "job", for which a request is returned as the job is requested. Put the job data on a queue, and persist some status in a database. If you can't avoid the syncronous HTTP for long processing requests, then it can be beneficial to put them on a queue. Heroku for instance recommends putting things taking longer than 500ms on a queue and using a background worker to process it. |
The input is coming from mobile devices camera with a rate of 4 images per seconds, already resized at 320x240px, in real time, and need to give back a reply in 300ms. That's why I was thinking about it such way. As after giving a reply to the mobile user, I will queue some async jobs for more advanced processing or logging. |
Hi,
Hope you are all well !
I was wondering how complicated it would be to add the surveyor pattern from Nanomsg in msgflo-cpp for adding some distributed search in the graph like described in the articles above.
Resources:
https://daniel-j-h.github.io/post/distributed-search-nanomsg-bond/
https://github.com/daniel-j-h/DistributedSearch
It would be cool to have a nanomsg socket, so could be used to communicate with other scripts; it would be efficient for image processing pipeline or computer vision pipelines to be more efficient.
Thanks in advance for your input.
Regards,
Richard
The text was updated successfully, but these errors were encountered: