Starting a GenServer that loads default state

Shouldn’t that be MyApp.Repo?
Also if you have a GenServer from a library, try not to make it an application itself. Better to add the GenServer in your main application like your second style, and also give it a unique name and necessary arguments in the child_spec, in your case you want to pass the Repo name into the GenServer’s start_link.