Django vs Phoenix

My impression in the majority of the responses is that Phoenix is great but not better than Django. Please help me decide where to focus on, vote if you will Phoenix or Django?

Why would you base your decision on some votes by random people? And I wonder what result you think you’ll get, considering this is an Elixir forum?

Spend some time to evaluate both frameworks and pick the one you are most comfortable with.

4 Likes

@egze I think most people can’t be wrong.

I haven’t read the posts in any great detail but I can tell you that Elixir/Phoenix users are confident enough in their choice to use it that we are not afraid to highlight the positives of other languages/frameworks :smiley:

Personally I think Phoenix is the best web framework out there and I think the opening chapters in the Phoenix book really do an amazing job of explaining why. Check out this post:

Also see this thread:

Hope that helps, and at the end of the day, just use what makes you happy or what you think is best for your project - pretty much what I think most people in this thread are likely saying :023:

5 Likes

@AstonJ thanks a lot you are always helpful, and yes Elixir/Phoenix community is the best! I think I will concentrate on Elixir, Phoenix, and Ecto. Django will be second.

1 Like

Like I said before, the django admin can be huge time saver. On the other hand if you need to deal with concurrency or background tasks then Phoenix will be so much nicer to work with.

Also after working with Elixir and its functional nature it’s kinda tricky to go back to mutable classes. It’s really so easy to reason about your code in Elixir which helps tracking down bugs.

If you need dynamic or live-upating HTML views then Phoenix live view is also a very nice feature. Sure, it can be done with javascript + websockets, but there’s way more complexity involved!

And finally working with GraphQL is amazing in Elixir - especially in combination with subscriptions. In Django we had very bad experiences, like huge perfomance drops once the datasets reached a certain size. Absinthe (the GraphQL library for Elixir) on the other hand was very fast and stable, even with complex workloads. It also outperformed Apollo (a node.js implementation) in our tests on complex workloads (deep trees).

6 Likes

Based on what definition of “fast”? What benchmarks are you basing this on?

2 Likes

I’m curious too. I consistently see flask benching as one of the slowest python web frameworks, even slower than ror.

1 Like

Don’t listen to me. I saw flask, thought python, and in my head was thinking about japronto.

1 Like

japronto is actually very fast for python yeah. ^.^

Web browsers aren’t implemented with JavaScript - but only “scripted” with it.

japronto

The server is written in hand tweaked C trying to take advantage of modern CPUs. It relies on picohttpparser for header & chunked-encoding parsing while uvloop provides asynchronous I/O. It also tries to save up on system calls by combining writes together when possible.

Sounds like this thing is implemented in C and scripted with Python.

So any Python code it has to execute (or wait for) is only going to slow it down. :003:


A million requests per second with Python

3 Likes

Yep, that is the point of japronto, it is trying to minimize the overall python code. Still pretty easy to use though (not that I’ve created any new python web server in about 5 years now). :slight_smile:

Hi, I’m an django dev whose just crossing into the elixir world. One the things I’m missing is an admin interface, which in django comes out of the box. I see there have been projects such as ExAdmin/Talon, but what are the currently top admin tools for elixir that are still maintained and ready for production use?

1 Like

Maybe torch: https://github.com/danielberkompas/torch

2 Likes

Torch looks awesome, nice interface and self generating admin what more do you need!

Is it Christmas!

Thanks very much for sharing @mythicalprogrammer

1 Like

I’ve used Django a lot, largely because of the tight coupling between the ORM, validation, and frontend rendering.

How would you all recommend someone new to Phoenix and Elixir get a similar feel and productivity level? I’m willing to write code, but I’d rather not write all the code. In reading it and going through a small workshop of Phoenix and LiveView, there are really cool pieces. However, I also feel like I’ll need to write a lot of features/pieces that the tight build the ORM and Django give me out of the box. Any libs and recommendations on how to accomplish the same sort of flow?

Welcome :023:

I’m not too familiar with the current state of Django (when I looked at it when I was deciding between it and Ruby/Rails its main advantage in my view was its built in admin panel) however with regards to the ORM we have Ecto, which is pretty fantastic :003:

I wrote some of my thoughts about Ecto in my review of the Programming Ecto (Pragprog) book (it might also give you a glimpse into some of the other benefits of Elixir).

With regards to ACP tools we have some too - though of course not as highly coupled as what you may find in Django: https://hex.pm/packages?search=admin&sort=recent_downloads*

2 Likes

I think this solution is just fine. ^^

1 Like

There is a new one called Mandarin, though it appears to be relatively early in development.

Use Django instead of Phoenix. Try to do a project in both and you will realize it’s faster and easier to develop in Django.

Phoenix has potential but needs to mature more.