Megatomix

Megatomix

Is it possible to program backend with pure elixir (direct SQL in BD) without frameworks? What are the challenges or problems?

Showing Posts 1 to 10

lpil

lpil

Creator of Gleam

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? :slight_smile:

sribe

sribe

Sure, as another example, I use Phoenix for routing etc, but not ecto: phoenix + postgrex.

Megatomix

Megatomix OP

PostgreSQL

Megatomix

Megatomix OP

I intend to use PostgreSQL

tnks

NobbZ

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

Megatomix OP

Sorry: a failed act at writing
BD = DB
BD in portuguese, DB in english (DataBase)

joelwallis

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

hauleth

Yes.

Less pleasant API and that will probably be it.

dimitarvp

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. :003:

lpil

lpil

Creator of Gleam

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

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews