Confex vs runtime.exs - which would you recommend?

Right now we’re using a mix of Confex and runtime.exs. It feels like we’re using two tools for the same job and we’re wanting to pick one or the other.

The nice thing about Confex is that you still have dev.exs, test.exs, and prod.exs. With runtime.exs we have a few cases of checks like if config_env() != :test do which feels a little less clean.

The nice thing about runtime.exs is that it’s built into Elixir and doesn’t require another dependency. I also read in this other post that “the community didn’t adopt Confex”. But we’ve used it at my last two jobs and it works great!

So I guess I’m curious what the rest of the community would recommend here. I definitely don’t think we want to be doing this two different ways like we are now.

1 Like

runtime.exs has worked well for me on smaller projects. I’ve seen GitHub - elixir-toniq/vapor: Runtime configuration system for Elixir be used in bigger projects. The main difference is that runtime.exs and Vapor were not available when Confex was available.

If you can make runtime.exs work for your usecase, I’d use it. If you need something more, maybe Vapor will do the trick for you (it has the dev/prod/local mechanism you mentioned).