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

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New

Other Trending Topics Top

mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews