Notes - Adding Ecto 3 to an existing umbrella project

Adding Ecto 3 to an existing umbrella project

On a recent project I found that, on higher loaded servers, the application was too write heavy for SQLite. A decision was made and Postgres was selected. During this move I decided that the best route would be to use Ecto rather than decoding the result sets from the Postgres driver.

A look at the Ecto documentation

defp deps do
  [
    ...
    {:ecto_sql, "~> 3.0"},
    {:postgrex, ">= 0.0.0"}
    ...
  ]
end

and Ecto was added to the database application in the project.

This was where the fun started!

When running

> mix deps.get

mix hung on resolving dependencies and used all available memory!

After some digging and reordering of dependencies in the mix file I found out that ecto_sql uses a project called telemetry. This was ultimately clashing with the one within the Umbrella project.

Some quick renaming and all was well.

Conclusion

Be careful with your application names (not that this is a hard problem). In future I will be fully scoping projects in an umbrella.