3 ms·
I really like Ecto for several reasons, but mostly because it makes every database call super obvious. If you Repo.something(), you're probably hitting the data
by regulation_d 9y ago
I really like Ecto for several reasons, but mostly because it makes every database call super obvious. If you Repo.something(), you're probably hitting the database.
A couple other reasons I like it:
1. It's makes shooting yourself in the foot with N+1 queries really difficult.
2. It's not married to Phoenix. I haven't tried this in a while and maybe this isn't representative of the current state of things, but last time I tried to use AR in a non-Rails project, I ended up switching to Sequel gem.
For a nice, if not slightly biased, comparison of AR and Ecto, I recommend Darin Wilson's talk "Thinking in Ecto"[0].
[0]: https://www.youtube.com/watch?v=YQxopjai0CU https://www.youtube.com/watch?v=YQxopjai0CU