One of the cool things to come out of Ecto 2.0 is the module Ecto.Multi. It is designed to be a way to group database calls into a single transaction so that the group fails if one fails. In other words, it’s all or nothing. This takes care of the problem we see above. There are no multiple levels of nesting and the API is actually really nice to work with. Let’s take a look!
Read next Genetic Algorithms with Elixir