35 ms·
>>I need to have a Db installed even though the application doesn't touch a the Db? No. You can use an in-memory repo, or a flat file. Phoenix's initial config
by enraged_camel 9y ago
>>I need to have a Db installed even though the application doesn't touch a the Db?
No. You can use an in-memory repo, or a flat file. Phoenix's initial configuration assumes you'll be using Postgres, but that's easy to change/remove.
>>Honestly, working with ecto outside of initial model creation looks kind of nasty. I could be looking at this wrong though.
Ecto is interesting. Coming from Rail's ActiveRecord, it definitely gave me a bit of trouble at first. But then I realized that was because I was thinking of it as an ORM, whereas in reality it's more like a library that maps the data in your database into data structures in your app (I say "data structures" because there are no objects in Elixir, remember). What that means is that it's functionality is not as tightly coupled to your data. Here's a more in-depth explanation (I'm not the author): https://www.amberbit.com/blog/2016/2/24/how-elixirs-ecto-differs-from-rubys-activerecord/ https://www.amberbit.com/blog/2016/2/24/how-elixirs-ecto-dif...
Over time I've come to appreciate Ecto, because it forces me to think more explicitly about what data I want to fetch/insert and how. It also makes the code easier to reason about.
RE: Dependencies, it's hard for me to say. I can tell you that compared to Ruby and Rails, Elixir and Phoenix are very lightweight. It's true that you need to install some of the underlying language tools such as Mix, but at the end of the day Phoenix follows a more a-la-carte approach compared to Rail's "everything and the kitchen sink" approach.