Megatomix
Backend with pure elixir (direct SQL in DataBase) without frameworks possible?
Is it possible to program backend with pure elixir (direct SQL in BD) without frameworks? What are the challenges or problems?
Most Liked
lpil
SQL query builders such as Ecto are just one approach to querying a database, other options are available, and in some other ecosystems these options more popular.
Personally I am a fan of writing plain SQL and have written a small library to make this a bit more convenient in Elixir. GitHub - lpil/yesql: An Elixir library for using SQL.
lpil
Hi Megatomic! Welcome to the forum!
There’s no need for any specific library or framework to make a backend in Elixir, it just means that you have to make more decisions about what conventions and patterns to employ, and you may need to implement some functionality that the frameworks might otherwise offer.
At my previous workplace we had Elixir services that didn’t use the Phoenix framework or the Plug webserver abstraction, instead we just used the Elli web server (which has a very simple interface). We could have also done the same with Cowboy if desired.
The Raxx web server would have also been a good fit, we went for Elli as Raxx didn’t have middleware at the time.
The service that had a postgres database used Ecto, though if writing it again we might have instead opted to use the Postgrex library directly as we didn’t find Ecto offered much in that specific use-case. Our tech stack was quite diverse so we found that keeping things as simple as possible and using as few libraries and macros as possible made maintenance and on-boarding easier.
So yes, it is possible to implement a backend in Elixir without frameworks.
What’s a BD? 
Megatomix
Sorry: a failed act at writing
BD = DB
BD in portuguese, DB in english (DataBase)







