8000 GitHub - DavidS-B/homer: Ulysse technical test · GitHub
[go: up one dir, main page]

Skip to content
DavidS-BPublic

About

Ulysse technical test

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Homer

Clone this repo anywhere you want and move into the directory:

$ git clone https://github.com/DavidS-B/homer.git
$ cd homer

Running this app with Elixir

Install PostgreSQL:

https://www.postgresql.org/download/

⚠️ For this project I used PostgreSQL v12.8

Install Elixir:

https://elixir-lang.org/install.html

⚠️ For this project I used Elixir v1.12.3, Erlang/OTP 24.1.2 & Phoenix v1.6.2

Build dependencies:

$ mix deps.get

DB set up:

$ mix ecto.setup

Start Phoenix server:

$ mix phx.server

or with the interactive shell:

$ iex -S mix phx.server

Run tests:

$ mix test

Endpoint access to create an offer request:

http://localhost:4000/offer_requests

Running this app with Docker

Install Docker Compose:

https://docs.docker.com/compose/install/

Build everything:

$ sudo chmod +x entrypoint.sh
$ docker-compose build

Start the app:

$ docker-compose up

Endpoint access to create an offer request:

http://localhost:8080/offer_requests

Questions

  1. 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.

  1. 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.

About

Ulysse technical test

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0