Deploying an Elixir App on AWS

I have a client that really wants me to use AWS to deploy an internal company database app. He seems really convinced I should be able to do this with ssh access into a single EC2 instance, aka without access to the AWS account itself. How do I explain that I cant do what hes asking without an AWS RDS or AWS terminal access. He says I can load postgres onto the EC2, which I haven’t seen on any deployment guide I’ve looked at so far.

I have it in a testing environment on gigalixir but he “doesnt want it hosted on someone else’s site.” I told him I could use his DNS and an AWS RDS alongside gigalixir and he said it needs to all be on AWS for reasons I dont think he understands.

NervesHub is deployed on AWS. https://github.com/nerves-hub/nerves_hub_web this is the repo. I don’t know very much about how it is deployed, other than docker and CircleCI are involved

Yeah but I’m sure you’re still leveraging a RDS from AWS right? Are you storing any sensitive data yourself?

So, you have access to an instance? You can install whatever you want, its not recommended, but if its what your client needs
The way I see he wants to install everything in one machine, a local pgsql alongside your app, very manual maintenance

1 Like

Although the answer is always “It depends”, your client is right that you can run your own copy of Postgres on an instance, and do so right next to your elixir app. A few things that come with that:

  1. You don’t get any managed backups, maintenance, patches, etc. If the node fails, and you’re not backing up properly, then you lose all the data. That’s what RDS aims to be.
  2. It’s not replicated for backups across availability zones. If an AZ goes down, you may not lose data but you won’t be online either.
  3. You won’t get HA for the Elixir App either if it’s just running on one node.

Simply put, it’s not a great production setup. That said, I run some side projects on a single VM including elixir and Postgres, and it’s fine if you’re okay with some of those caveats, or if you can articulate that to your client and they say, “Nope, I really want it this way on AWS”.

I’d look at https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04 to install Postgres directly on an Amazon VM (assuming it’s ubuntu - but you could tailor these instructions for Redhat/Centos/Amazon’s linux distro).

My personal preference is to deploy stuff like this with Docker. I prefer it for keeping isolated environments on the same overstuffed VM. https://hub.docker.com/_/postgres has the details on how to get the image up and running, but it’s not an exhaustive crash course on all things docker if you are not familiar with it.

5 Likes