matiso

matiso

Migrating from Rails to Elixir, bit by bit

At my company, we decided to slowly move away from our current Rails application to Elixir. At the same time, we don’t have the resources or time to freeze all development for 6 monts and rewrite everything from scratch. That won’t happen.

What we thought is the way to go is that we might start replacing specific routes / components with Elixir applications (going to use Umbrella applications for that).

A large chunk of the Rails application that needs to be ported first is accessible as HTML or JSON/REST. We thought that one possible solution would be to have an Elixir / Phoenix application that would act as a proxy for the requests. If a specific route was already ported to Elixir, it would render the specific route. If not, it would fall back to the Rails application. Also, a quick switch would be nice, so that we can go back and forth in case stuff goes bad during the migration.

Any ideas / suggestions on how to implement that? The closest I could get to this approach is by using Nginx as a proxy, but it’s a bit more complex to allow the switching in a more or less dynamic way.

I’m hoping there is a way to do this in Elixir. Any ideas?

Most Liked

LostKobrakai

LostKobrakai

This might be a nice start: https://github.com/poteto/terraform

outlog

outlog

reverse proxy, with either rails or phoenix in front… (in your case it sounds like you would keep rails in front, given a slower tempo)

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

rails in front:

depending on your setup/use case you can also run with two URIs on the client - (eg if you do header auth or something)

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
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

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
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
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
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement