iainduncan

iainduncan

Using Elixir or Erlang as reverse proxy in front of other services?

I have a legacy over-coupled system (large!) that we are slowly breaking into a polyglot backend of cooperating services and I’m just exploring some options so this might be a dead end or not. Some parts of our app are great fits for elixir, and others we might leave alone (for now). In Python, one can split off parts from the main app with WSGI middleware, where the middleware almost acts like a proxy (I think plug is very similar in many respects). I’m wondering whether it might be feasible to do something similar for parts of the app across the two languages by having an Elixir layer act as the incoming request handler that either a) handles the whole thing and sends back the response or b) proxies on to the python app servers, which could take a while. So in case (b), the request connection could be open for a long time because we have some terrible db crap going on some of the time. I realize the proxying may add response time, but at the moment our response time is bad enough that this is likely the least of my worries. I expect that farming out what I can to Elixir will more than make up for this, though I would love to hear otherwise if I’m wrong.

Has anyone any experience with using either Elixir or Erlang apps in a similar pattern or with reverse proxying off them in general? Any tips or advice much appreciated.

Most Liked

idi527

idi527

I might be wrong, but I think going down the reverse-proxy-in-elixir path would require a non trivial amount of work that can be avoided – wouldn’t it be easier to have something like haproxy or aws load balancer do the proxying, and rewrite your pyhton app in elixir piece by piece? I worked with someone who was transitioning from ruby to elixir, and that was exactly what they did.

In the case you do decide to build this, maybe these projects and blog posts might help you

https://github.com/josevalim/proxy

https://blog.fourk.io/replace-your-production-api-with-elixir-today-4426a8903642

Where Next?

Popular in Questions Top

LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
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
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
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
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
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement