AWS Fargate deployment architecture for Elixir/Phoenix app.

Looking for any documentation on how an Elixir/Phoenix app should be architected on AWS Fargate. Coming from a RoR background I’m familiar with: nginx --> passenger --> my_app.

What is the recommended equivalent for an Elixir/Phoenix app?

Thanks in advance,

In AWS even with an RoR app you don’t need a nginx sitting infront as an ALB would do the load balancing for your target group. Similarly you don’t need an reverse proxy/web proxy in front of phoenix app if you are running in AWS unless you don’t want to use the E/A/N-LB and want to do your own load balancing. I am not familiar with AWS Fargate as such but in a ECS you would have your cluster which can have your target group and a LB would point to that target group app. The only thin to note is if you are using sockets then you would need to chose NLB as ALB and ELB are not good at managing connections as they are under the hood built using AWS autoscaling and the connections can vanish. If you were going to use nginx as a reverse proxy then your flow should generally look something like this

nginx -> (N/E/A)LB -> Target group (phoenix app container)

for phoenix it comes with an app server cowboy it is i think which is what in RoR world equivalent of passenger/unicorn/puma

1 Like