I’ve come across a number of opinions in the Elixir community talking about how your domain model and your database models are best kept separate (ex: Dave Thomas and Lance Halvorsen). This is great since I’ve run into that issue in previous programming environments (Python + SQLAlchemy).
At some point, though you need to make your application’s state persistent. Can anyone point me to resources about how to do this (presumably with Ecto) in a way that preserves separation of concerns?
Thanks for the quick reply! “Ecto is in the business part” is helpful. Are there any example repos, posts, or books that anyone can point me to, though?
Ecto follows the Repository Pattern which helps separate the pure from the impure and Phoenix encourages working with Contexts, which is made easy by Ecto. The Ecto book says Phoenix Contexts were inspired by the concept of bounded contexts as described in the Domain Driven Design book.
If you haven’t read it, I highly recommend the Ecto Book - it’s so easy to read as the examples are clear and easy to follow. Check out my interim review here