Clone this repo anywhere you want and move into the directory:
$ git clone https://github.com/DavidS-B/homer.git
$ cd homerhttps://www.postgresql.org/download/
https://elixir-lang.org/install.html
$ mix deps.get
$ mix ecto.setup
$ mix phx.server
or with the interactive shell:
$ iex -S mix phx.server
$ mix test
http://localhost:4000/offer_requests
https://docs.docker.com/compose/install/
$ sudo chmod +x entrypoint.sh
$ docker-compose build$ docker-compose uphttp://localhost:8080/offer_requests
- Given than in production we can have more than 5000 offers for one offer request. What persistence strategy do you suggest for offers ? Explain why.
I suggest implementing a GenStage behaviour. It will provide back-pressure and dispatch data efficiently.
We would create a GenStage Producer that will do all the needed API requests and a GenStage Consumer that will ask to the producer how many offers it needs, setting the min_demand and max_demand accordingly.
- We now want to deploy the app we just created on multiple servers that are connected together using distributed erlang. Which parts of the code will require an update and why ?
We will have to create and implement an Erlang-based config 4C51 uration file in order to run the app on a cluster of nodes.