AWS architecture design for Phoenix app

Intro

T0ha
3∑: Elm, Erlang & Elixir
2 min readJun 27, 2019

--

Imagine you have just finished developing your brilliant startup on Phoenix.

What’s the next step? Yes, you are right. It’s time to test it and show to its first users.

In the previous article, I’ve shown the way to deploy the application to an Ubuntu server: everything to one place. This way is rather good if your project’s load is not very high.

But what if it grows? Then it needs to be scalable enough to handle as many customers as needed. This is where Amazon Web Services come to the scene.

In this article, I will guide you through creating suitable AWS architecture for your basic Phoenix project.

Requirements

To move forward with this tutorial you need:

  • a Phoenix application that has at least 1 Schema
  • git repository, preferably, hosted on GitHub
  • Amazon Web Services console account.

Overview

In this tutorial, we are going to create AWS architecture shown in the picture above.

In Part 1, we’ll make our app to work in AWS in the following way. Our application will work in ECS container which will connect to RDS Postgres DB instance and S3 bucket for uploaded assets. Users will connect to our application through https serving by CloudFront.

To make things easier, in Part 2, we are going to set up continuous integration with Code Pipeline. It will take source code from our GitHub repo after any update of the ‘deploy’ branch. Then it will build the code, run dyalizer and tests. If they fail it will inform the Project manager by email. Otherwise, will build a release and deploy it to a staging container with temporary DB. When it’s ready, it will inform QA to test and accept production deploy. After deploy is accepted the pipeline will spin up container connected to RDS DB and that’s it.

In Part 3, we are going to create CloudFormation stack for all this stuff and discuss some alternatives to it.

PS

Dear readers, thank you for your interest and feedback.

You are welcome to support this article by clapping, subscribing to the publication or following T0ha.

Do you have a tech startup idea? Or do you need some help with web, mobile or IoT programming?

Visit 3∑ website and get a great offer from us.

You can contact me by Email (ceo@3epsilon.pro), Twitter (@t0ha666), Reddit (/u/t0ha) or Telegram (t.me/war1and).

See you next time…

--

--

T0ha
3∑: Elm, Erlang & Elixir

#Founder & #developer focused on #startups rocketing and #socialimpact.