Shrike

Shrike

Hey,

I’m thinking about writing my first Elixir backend server, and I’ve been wondering if I should use Phoenix or a simple cowboy server for it.
What I’m going to do is have a simple api server which queries a db and most probably would send rest requests to another server when needed (this part of the architecture wasn’t decided yet)
This backend server would have to auth and in the future probably authorize users but it won’t handle the user session.
I wonder if Phoenix would be an overkill for such a simple backend server, as from my experience rails is.
Would appreciate any input.

Thanks,
Shrike

Showing Posts 1 to 10

OvermindDL1

OvermindDL1

Phoenix is primarily a set of plugs (and optionally a nice websocket handler) on top of cowboy, it can be as slim as you want it to be, and as such you should use it, just remove what you don’t need from your endpoint if you so wish, and you can grow it later if you need. :slight_smile:

Shrike

Shrike OP

Thanks for the super fast reply.
It’s just when using ruby I found out that Sinatra was the best fit for this kind of servers, Rails just requires way too much fuss to make such simple severs.
Guess I’m still thinking ruby.

OvermindDL1

OvermindDL1

Yeah, Phoenix is not at all heavy, it is rather very lightweight, especially as you can pretty trivially pick and choose what of it you want to use. The default generated endpoint is showing off a lot of common features (not even all) and those you do not need to leave in if you don’t need them. Like if you don’t need static file hosting then remove that plug call, or if you don’t need a router then remove that call (finish up with a final single plug or so). Etc… etc… You can pick and choose and mix and match what you want. :slight_smile:

AstonJ

AstonJ

You haven’t seen nothing yet :lol:

According to legendary people like Dave Thomas (i.e PragDave) Phoenix is much more than a web framework :003:

I know I’ve said this a million times on the forum now, but I highly recommend his Elixir course - it blew my mind, and is one of the best courses I have ever done :023:

(In case anyone is wondering, no I am not on commission!! Wish I was though, I reckon I could sell his course all day long no sweat :044:)

OvermindDL1

OvermindDL1

Hear hear! It is a whole way of Structuring the program, it is well worth following. :slight_smile:

AstonJ

AstonJ

Yup! It gets even more mind-bending when you factor that you can use more than one Phoenix layer in your app - can anyone imagine using more than one Rails ‘app’ in their apps? Nope, neither can I :lol:

Shrike

Shrike OP

I’ll take your word and go through it before starting the work on the server, hopefully I won’t have to start with ruby and Sinatra and do a move later, time frame is going to be really short for this project.

AstonJ

AstonJ

Nice :023:

I would recommend reading Programming Elixir first if you haven’t, though depending on your experience you may not need to (I would anyway though as it’s an excellent book, as it’s Elixir in Action).

Let us know how you get on :slight_smile:

OvermindDL1

OvermindDL1

If time frame is super short then use what you know. ^.^;

If you want to learn something new, Elixir and Phoenix will get you going with something fast that will run very well though. :slight_smile:

Shrike

Shrike OP

Well this is going to be my first experience with Elixir but I’m not afraid to try new stuff.
Already did a move from Perl to Ruby without previous experience with Ruby on a production server.
The main decision maker would be how much time I’ll have for this server, Ruby + Sinatra would require a day or so Elixir most probably a week or so.
First iteration of this server wouldn’t need to be prefect it would just need to work and be secure. In the future it would need to be fast, but that’s a problem for the future;)
So the decision would be time, I do know and expect that in the second stage of this project it would need to be lighting fast Elixir is the perfect fit, and I want to have my first experience with Elixir when I can make mistakes and don’t have to worried about benchmarks.

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
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
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
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
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews