A noob question: How do you deploy your distributed Elixir/Phoenix application?

The question may not be explicit for Elixir, but as we’re in ElixirForum so better we talk about things in Elixir perspective.

I am a noob, and I never deployed a distributed application, and never scaled an application to say multiple machines. I predominantly created WordPress websites with some CodeIgniter or Plain PHP websites and none of those websites ever needed to scale.

I read/watched about deploying an application in distributed manner, so I know the basic ideas and terminology, but my knowledge is blurry about the following things, (I’ll add more points as soon as they come to my mind);

  1. In a distributed application (an application living on multiple machines, either monolith or micro-servies based) where does the database live?
  2. Where does the user files live?
  3. Is a messaging queue required for a distributed Elixir/Phoenix application like distributed applications based on other technologies (like Rails or Flask).
  4. Is deploying a distributed elixir application on docker a good idea?
  5. If I take a course about distributed applications in other technologies, like AWS Developer: Building on AWS at Edx which uses Flask application to teach AWS, would this course benefit me if I want to use the ideas for a distributed Elixir application deployment?
  6. In case of deploying to dedicated bare metal servers (like Scaleway etc) instead of cloud, what things should I take care of.

I’ll be adding more points, but if you think I missed important point, please let me know about that, and please share any links which can add to my knowledge. And if there is some free course(s)/tutorial(s) please let me know about that too.

Thank you!

2 Likes

About trainings
For sure is to good take this course. To see how build application in cloud.

I see edx has two courses



There aslo courses dedicated to lamda only

AWS services you can use to build application (2015)

Database is hosted by AWS as service.
You have some options like relational databases or no sql.

AWS has storage services like S3

2 Likes

and it’s second part might serve you as a good introduction into distributed (with some kind of shared state) apps.

1 Like

fixed :slight_smile:

  1. The database server can be separated from the web part. You configure this through Repo. In case of micro-services, each would hold a separate db. In case of distribution, You could use a shared db, or have a copy on each node. There would be a need to keep data in sync. You can also find distributed db, like Riak, Mnesia.

  2. If You speak of user data, they would be in db. If You speak of files… You can decide that one node would be in charge of a group of users, while another would have another group.

  3. There is less need for tools because distribution is a built in feature. Concurrency is already some sort of distribution. Erlang provides :pg2, :global, :rpc. Phoenix Presence is a distributed solution based on :pg2.

I highly recommend the chapter 12 of Elixir in Action, 2nd edition.

You should have a look at the CAP theorem.

For question 4, 5 and 6, it is a personal choice, You may have lots of valid solutions.

1 Like

There are also CRDTs


But I would say don’t try to implement your self :slight_smile:

1 Like