Megatomix
Is it possible to program backend with pure elixir (direct SQL in BD) without frameworks? What are the challenges or problems?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex











First 10 of 19 Posts
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?
sribe
Sure, as another example, I use Phoenix for routing etc, but not ecto: phoenix + postgrex.
Megatomix
PostgreSQL
Megatomix
I intend to use PostgreSQL
tnks
NobbZ
Postgres is a RDBMS, relational database management system. I’ve not yet heard someone classifying it as a BD.
Could you therefore elaborate on that term?
Megatomix
Sorry: a failed act at writing
BD = DB
BD in portuguese, DB in english (DataBase)
joelwallis
Hi @Megatomix,
I don’t see any blocks that would keep you from interacting directly with a database, without using a library. I also don’t see a good reason to not use a library such as Ecto, tho. Why would you like to do such a thing?
By the way, the answer for your question is YES. It’s completely possible to interact with databases directly. You would still have to deal with the issues that libraries like Ecto solve, but assuming you have a good reason to do so, and your preference for Postgres, I would advise you to take a closer look at
postgrex, the package that allows you to interact with Postgres using Elixir.hauleth
Yes.
Less pleasant API and that will probably be it.
dimitarvp
And crying yourself to sleep because you don’t have proper queries, joins and aggregations which you will inevitably need no later than two weeks in the project.
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. · GitHub