Ecto (https://hexdocs.pm/ecto/) is a functional data mapper for Elixir. Ecto does two things right, restraint and hide the data underneath. Ecto is explicit.

Ecto.Schema (https://hexdocs.pm/ecto/Ecto.Schema.html) define the relationship and the fields between the tables. This module will generate the model to interact with the database. This code is written with Elixir meta-programming.

Ecto.Query (https://hexdocs.pm/ecto/Ecto.Query.html) permits to write explicit queries, the query look likes SQL queries. Inspired by many other projects. You should think about the select part of the request. There exists a preload function, used to preload information on a query based on relationship. We can build queries incrementally by joining different queries directly in our code.

Ecto.Repo (https://hexdocs.pm/ecto/Ecto.Repo.html) is a pattern used to represent the database. Repository pattern is not new, you can read "Patterns of Enterprise Application Architecture".

Ecto.Changesets (https://hexdocs.pm/ecto/Ecto.Changesets.html) is a new abstraction to valid data and relation between inserted values in the database. This module permits to define a specific validation for one or more model instead of all libraries on the market. It makes things easier to refactor and extend.

Ecto.Multi (https://hexdocs.pm/ecto/Ecto.Multi.html) is used to insert multiple values at the same time based on SQL transaction. Each data must be valid to be inserted at the same time during the commit. Rollback action is automated with this module.

Ecto gives you the opportunity to read and update data by using different kind of models instead of using only one defined model.

Testing with Ecto, gives you also a better way to test values, isolated side effect, does not use mocking and stubbing and make concurrent testing easy.