5 ms·
Anyone here with Django and Phoenix experience? Is there any reason to use Django over Phoenix now?
by rpastuszak 5y ago
Anyone here with Django and Phoenix experience? Is there any reason to use Django over Phoenix now?
- ttymck 5y agoThe most compelling reason is probably still the open source ecosystem. There's just a relative plethora of django extensions and plugins that Phoenix (and Elixir) lacks.
- toolz 5y agoI hear this all the time, but what exactly does the elixir ecosystem lack? It's older than the python ecosystem (open source release was much later), although not nearly as popular but since elixir can drop-in erlang libraries as easily as "native" elixir libraries (caveats exist) I'm not sure I find this statement to be nearly as correct relative to how often I hear it stated
- cuddlecake 5y agoParent is specifically talking about Django, and I'm not sure if there is anything comparable to Django in the Elixir ecosystem. So, if there is an absolute necessity for time-to-release at all costs, I reckon Django would probably have some advantage over Elixir.
- lawik 5y agoYeah, for some use-cases the Django Admin and everything-spawns-from-the-model approach can go from nothing to CRUD in a ridiculous time. Phoenix is ludicrously quick to get from zero to realtime UI and interesting backend work such as polling, consuming updates, sharing state, collaboration. Having done a bunch of Python I wouldn't discount Django but I would pick Phoenix almost every time at this point. The initial burst of Django doesn't seem like a long-term upside and Elixir/BEAM/Phoenix has a lot of long-term upside in my eyes.
- ttymck 5y agoAnd, by my estimate, Django has been around ~9 years longer than Phoenix. Comparing DjangoPackages[0] and awesome-elixir[1], sure you could say "there's an elixir package for everything", but how battle-tested are they? How well-maintained are they? If someone is trying to decide between Django and Phoenix, I am not sure how likely it is that the individual would have the necessary Elixir/BEAM experience to be confident in dropping-in erlang libraries. [0] https://djangopackages.org/ https://djangopackages.org/ [1] https://github.com/h4cc/awesome-elixir https://github.com/h4cc/awesome-elixir
- cultofmetatron 5y agoif your team already knows python and you don't need realtime websockets as a first class feature, django is probably a better bet. The best language for yoru project is always the oen you can drop preexisting libraries for in a language you already know. That said, I delved into elixir and haven't looked back. My ios engineer is always mentioning how crazy fast it is compared to previous stacks he's worked with.
- rpastuszak 5y agoYeah, I think it's quite interesting in a sense that it tackles a similar problem than say Next + Prisma, but in a more opinionated (convention over configuration) way. Coming from Node, having to mess with WebSockets in Django feels so backwards, although I do appreciate less cognitive load when you're dealing with more traditional, MVC + REST style apps.
- mehphp 5y agoThat's something only you (or your team) can answer. Does one of them help you solve a problem better than the other? If you can't articulate an answer to that, then I would suggest using whichever your team is most productive in.
- rpastuszak 5y agoOf course, 100% agree, but I'm after concrete examples from other teams, because at the moment I belong to only one, which is a limited sample:) and I'm curious. I should've asked what are the cases when one outperforms the other? Or, what are the cases where Django is a better choice than Phoenix (besides talent, available libs, etc...). Or even, better, what are the concrete examples in which one is a better choice--from your own experience? Given my (fairly superficial) experience with both Django and Phoenix I can see a tonne of similarities: convention over configuration, generators/scaffolding, ORM, fairly similar project structure (to some extent). At the same time things such as realtime/WebSockets feel so unnecessarily complex in Django and so much easier to work with in Node, Elx, Go, literally anything else. I feel like Django fits in the niche once occupied by RoR, whilst Phoenix has a stronger overlap (in terms of use cases) with something like Next.js + Prisma.
- mehphp 5y agoJust a nitpick but Django is definitely not convention over configuration, you might be thinking of Rails. > At the same time things such as realtime/WebSockets feel so unnecessarily complex in Django and so much easier to work with in Node, Elx, Go, literally anything else. So this is where Elixir shines. If you need highly scalable real-time applications, then it's no contest. If it's a pretty straightforward crud app then it's really going to come down to preference. > Or even, better, what are the concrete examples in which one is a better choice--from your own experience? I personally chose Phoenix because of liveview. It removed the need for me to maintain what feels like two separate apps when you have a back-end and then a front-end in React/Vue/whatever.
- deleted 5y ago[deleted]
- pantulis 5y agoYou could say the same for Ruby and Rails, to be honest.
- rkangel 5y ago[disclaimer - am an Elixir and Phoenix developer, and a Python developer, but only a little bit a Django developer] Django still has a bit more stuff out of the box or from the community. There are various pieces that you can use from scratch. For a lower complexity, simple web app if your team hasn't built their "usual needed bits" Django is probably going to give you more. Elixir/Phoenix is a much better platform that is going to help you more once you're out of the initial bring-up. E.g. they provide authentication templates but explicitly don't just hand you auth because they philosophically believe that it's too integrated with your app that "one size fits all" can ever work (I agree with this). Once you need to do backend work, it's just more Elixir rather than Unicorn etc.
- bcrosby95 5y agoI've never created a consumer facing webapp in Django, but because of the automatic admin stuff I love to use it for quick internal webapps where the prettiness of the UI doesn't really matter.
- sergiomattei 5y agoDjangonaut learning Phoenix ATM here. My initial thoughts... - way less out of the box. you’ll have to spend sometime getting a boilerplate up and running, especially if you’re making APIs, as with solutions like pow aren’t the best for that use case - having your tests run instantly and webpack or node running on the same process is just life changing - there is no equivalent of something like Django REST framework for Phoenix, which is annoying, but writing Phoenix is quite productive so it’s all pretty trivial - ecto has a huge learning curve if you’re coming from the Django ORM - you will miss the admin panel, and solutions out there are really janky. stuff like Kaffy, ExAdmin... they’re awful. - documentation is really low tier compared to Django, especially when it comes to Phoenix. I was spoiled by how good the Django docs are and with Phoenix it’s been mostly digging through old forum threads for basic stuff. Docs assume a lot of prior knowledge about the elixir ecosystem, making it hard for beginners, unlike rails and Django. Their docs need a lot of work. - community can be a little elitist or idealistic. Try asking how to get JWT auth running on elixir forums, watch it get shot down in minutes because “jwt is insecure”. they can be very friendly but also very unhelpful, sometimes lacking pragmatism - unmaintained packages left and right - being able to send email asynchronously or do websocket stuff without worrying about memory leaks is just glorious. doing that in Django channels, deploying to production was just a cycle of crossing my fingers worrying that the slightest bug would take down the entire runtime. python async absolutely sucks garbage I can’t understate that last point. I’ve deployed multiple socket apps with Channels to production, and it’s always been a major pain in the ass on the long run. I spent months debugging a memory leak in Django Channels that only happened in production. Turns out an external package, sentry-python, wasn’t playing nice with ASGI. Async Django is painful and slow. I wouldn’t wish it on anyone. I have more thoughts written down somewhere, but this is off the top of my head. All in all: it’s been interesting, very fun. There’s tradeoffs to make, especially in productivity and documentation, but I feel they’re all worth it. Today’s apps demand speed, real-time, and concurrency. Django just feels stuck in a time warp from the last decade and Django channels isn’t progressing fast enough (add that async python is painful). Maintainability and reliability is important for me as a solo maker. I want a resilient web app that can operate without babysitting, I'm a full time student. Performance matters to me as well. I can't have a memory leak taking down my runtime every hour, or a slow request causing midnight support emails. Elixir is just pleasantly fast at everything: unit tests are async, the server is concurrent, everything is just blazing.. Realtime is important for me because you don't always need it, but when you do, it's nice to have it. Knowing that Phoenix has a rock solid implementation makes me use it more. It helps me effortlessly make next-gen products. Elixir and Phoenix come with performance/reliability guarantees, maintainability and new capabilities like flawless real-time that make it all worth it for me. This is my next upgrade to my stack and I’m really happy with it so far.