Ask HN: So, what's up with Phoenix (web framework)?
I&#x27;m using django for more than 10 years, phoenix for like 4. I consider myself experienced in both frameworks. I wanted to write some blog post about my experience with them, but never found the time.<p>In any case, Phoenix is a fine (niche) framework but can&#x27;t really be compared to a masterpiece like Django:<p>* Phoenix, probably because of its influences from the ruby world is using some concept called &quot;generators&quot;. Using the generator it will generate (sometimes a lot) source code files that will implement some functionality. For example, let&#x27;s suppose you create a new schema (similar to the django model concept). You can use the generator so it will automagically create code for the schema file, its migratinons, some crud forms and even tests. This works fine until you need add another field to your schema, or you need to rename a field or just do a small mistake! Then you&#x27;ll need to do some very error-prone and boring work. Compare this to the way that Django uses the Model to generate everything from that using class inheritance and composition, without the need to write <i>any</i> code. Also notice that the phoenix generators can&#x27;t understand relations and you need to edit the schema and migration files by hand to properly add references.<p>* No auto-migraton support. That&#x27;s that. If you add a field to a schema you need to edit the migrtion file yourself. Django automagically understands the changes and will generate the migration file.<p>* This generator thing unfortunately has influenced various other stuff from phoenix, like authentication (you use generators to create some kind of authentication code which then you need to edit). Again, compare this to the elegance of Django using the authentication backends. Also you use generators for presence, channels, whatever...<p>* The &quot;ORM&quot; (which is not really an ORM it&#x27;s more or less a way to talk to the DB called ecto) is miles behind the Django ORM. It doesn&#x27;t support any andvanced stuff, you  need to do the joins yourself (i.e from(u in User), left_join: (a in Authority), on: a.id = u.authority_id, where: u.is_active == true. Compare that to User.objects.filter(is_active=True).select_related(&#x27;authority&#x27;).<p>* Also the ORM doesn&#x27;t support most of the advanced stuff and you need to use an escape hatch called &quot;fragment&quot; that allows you to write raw SQL.<p>* Phoenix has no django admin. nuff said.<p>* The phoenix has some funny controller&#x2F;view&#x2F;template architecture (which I also think that was influenced from rails) that isn&#x27;t very intuitive. The views are more or less useless and everything is like router -&gt; controller -&gt; template. Similar to urls -&gt; views -&gt; template in Django. But having the unnecessary views there adds another level of abstraction making everything more complexfor no reason.<p>* Things like template inheritance are not really possible in phoenix. You use a thing called layouts to re-use stuff. The Django template inheritance is much, much more powerful and simple to understand.<p>* Django is much more batteries included: Phoenix has more or less no authentication (beyond the generator generated one I mentioned before), no caching framework (you need to use some kind of extension), no pagination support (!), no permissions and various other things that you&#x27;ll need to implement yourself or find some obscure library that has 3 years to be updated and doesn&#x27;t suport the latest phoenix, which gets me to the next point:<p>* Phoenix needs a JS bundler for its javascript code. It used to use webpack and now uses esbuild. Still, they could just provide the proper compiled JS files and let us decide if we wanted to use any node-js stuff (which I avoid like hell).<p>* Re-using code among controllers is possible using plugs but definitely not as straightforward as extending class based views with mixins.<p>* The ecosystem is very very small. Most libraries&#x2F;extensions are 1 person projects and most of these are from persons that tried phoenix for a project but moved on so they are unmaintained. I remember that there was the &quot;default&quot; pagination library in phoenix (scrivener) and it didn&#x27;t support the latest phoenix for like 2 years? People had to use a fork instead.<p>* Better support and much easier updates. Because of the huge different in users, when you have any problem with django you&#x27;re going to easily find answers on line. Also because Django is more mature and much more eyes look at its release candidates, it will be much easier to update to new versions. I&#x27;ve got apps that started from Django 1.6 and now are at 3.2.<p>* The documentation of phoenix is not bad but it can&#x27;t be compared to the django docs.<p>Yes I know that until now I only told bad things about Phoenix but it&#x27;s my experience and especially when trying to compare it with something definitely better. However I have used phoenix in a couple of <i>specific</i> projects and these were sucesfull. My opinion in that phoenix is <i>not</i> a general purpose framework but a niche one. When you have some specific requirements then yes phoenix would be a fine solution. These requirements are real-time updates using websockets. It&#x27;s exactly the niche that Django (and python is general) is not good.<p>Phoenix, because of elixir (and erlang) is great on supporting small processes that can be used to implement quick real-time communication between clients and server so as to implement apps like chat servers, online games, broadcast communication server etc i.e when your http clients open a websocket and send&#x2F;receive real-time updates to the server.<p>To enhance that even more, phoenix has a technology called Liveview that makes all this stuff even easier because it allows you to do client-side updates from the server side so as to keep JS to a bare minimum; instead of using react in your client side you keep all your app server side. This <i>is</i> a revelation and a much better way to work than using the client side JS framworks. This probably is the reason that Phoenix is loved so much more.<p>Please notice that I didn&#x27;t compare Elixir&#x2F;Erlang vs Python. Elixir can be used to create some stuff that can&#x27;t be done in Python (i.e using processes to schedule or queue stuff etc) but these are not Phoenix&#x2F;Django related stuff.<p>Sorry for the long comment, I guess I should have written the blog post ...