iainduncan

iainduncan

Integrating with python, design sanity check sought

Hi, I’m hoping I can get a check from more experienced OTP’ers as to whether this design is sane. We are slowly improving a big legacy monolith built in Python, and I’m moving bits to a CQRS style system with the read side using elixir where we can, and more work farmed out to microservices communicating over rabbitmq as well as http. It would be really helpful if we could do server-push for updating clients in eventual consistency situations or when async operations are complete. I’m imagining something like the below, and would love to hear if I’m on the right track or about to commit grave errors. :wink:

  • on login, users get a jwt token, allowing their login info to be honoured by any back end service
  • they also get a phoenix channel and/or a genserver (I’m still learning!) for their session
  • they get some js running to receive messages from their channel/genserver
  • browser events might send code to either the elixir server(s) or to the python server(s)
  • stuff happens, sometimes in python, sometimes in elixir
  • events originating in Python code when async tasks finish broadcast messages out over rabbitmq
  • user session genservers might listen to these rabbitmq messages and push results out
    to the client to show results in javascript, so we don’t need to do any server-push or websockets in python

Questions:

  • is using rabbitmq a decent way to integrate genservers with non-erlang code? if not, what is?
  • does the above sound reasonable in general? Anyone done similar stuff and have suggestions

thanks!
iain

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 48342 226
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New

We're in Beta

About us Mission Statement