This repository has been archived by the owner on Jan 30, 2025. It is now read-only.
Why I chose Elixir & Phoenix for Zoonk #177
ceolinwill
announced in
Blog posts
Replies: 0 comments 1 reply
-
Switched from Next.js to Rails for the same reason. I've explored nearly the entire web development ecosystem in search of the ideal solopreneur solution with numerous first-party libraries, including analytics. I'm consistently keeping up with Uneebee's progress — keep up the great work! Thank you for sharing your progress publicly. 🤝🚀💯 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This post is the answer to a question I got on Twitter.
I established the following criteria for choosing a framework for Zoonk:
Frameworks
I considered the following options:
Moving fast
I've been working with JavaScript for 14 years and I had lots of experience with Next.js. So, that was my initial choice. But, even though I love Next.js, I don't consider it a really full-stack framework since it doesn't come with the model layer and I wanted to reduce the work I have to do. Plus, Next.js uses a lot of RAM when using
npm start
. I'd need a serverless solution but they can get quite expensive. 1TB of extra bandwidth on Vercel, for example, costs $400. I wanted something more cost-efficient.Rails, Laravel, Django and Phoenix seemed much more robust solutions for moving fast as they have more full-stack features working out-of-the box. Database, Auth, Mailing, Background jobs, etc.
Customize
Requirements often change. Problems happen all the time. I wanted something that was easy to debug and customize. Rails favors "convention over configuration". That's good for moving fast but not so good for customizing. There are certain ways to do things and I wanted more flexibility.
Phoenix, Laravel and Django felt easier to customize. I love how flexible Phoenix is. Their generators, for example, just write the code for us. This means we can easily customize all the generated code.
Performance
Built on top of the Erlang VM, Phoenix deals much better with concurrent connections. It's very efficient RAM-wise. I've been quite impressed how much I'm able to accomplish with just 256MB RAM. I had some issues with other frameworks when using low RAM.
Its performance is so good that I didn't even feel the need to use something like Redis for caching.
Interactive
This one was hard and almost made me move back to JavaScript. I'm building an application to create interactive courses. Even though it looks simple now, it will have much more interactivity in the future.
Laravel has Livewire, Rails has Hotwire, and Phoenix has LiveView. Django has some community alternatives but nothing that seems much popular. I worked with Django in the past and we usually had JS frameworks for the frontend.
I love how smooth Livewire and LiveView are. I'm still a little bit concern about LiveView using WebSockets because it requires a permanent connection with the client, which could be bad if your connection is unstable. But, overall, I liked how little JS I need to write with LiveView.
Tooling
I think they all provide good tooling but I was quite impressed by how many things Elixir provides out-of-the-box, especially testing, formatting, and even documentation.
Jason Stiebs wrote a good blog post about it.
Type-safe
Even though Elixir isn't a typed language, it provides good tooling to make it type-safe. Using a combination of Typespecs and Dialyzer has been good enough.
Conclusion
Phoenix provided a great cost-benefit. Excellent tooling and performance, I can easily create interactive UIs using LiveView, it has good enough type-safety with
Typespecs
and it's highly customizable. Plus, it's a functional language, which is my favorite paradigm.The main down sides are:
Beta Was this translation helpful? Give feedback.
All reactions