5 ms·
Phoenix and Elixir, if you understand the choices made, is also a wonderful choice. The whole contexts thing allows you to design your system as micro services
by andy_ppp 6y ago
Phoenix and Elixir, if you understand the choices made, is also a wonderful choice. The whole contexts thing allows you to design your system as micro services before you even add in network partitions, and Ecto, not being an ORM (it’s a DSL for writing SQL in elixir) is incredible, better than it’s possible to be in active record. Then there’s channels, presence, performance etc.
- syspec 6y agoI want to use this, but every time I try to switch it is not there yet. Sure it has the core stuff, but things like ActionMailer and the built in S3 support in ActiveStorage, Devise, keep me going back. Too many of those things are not there... yet ... with Phoenix Also nothing beats active record after they added Arel which turns your query into an AST and optimizes it before sending it out - Ecto is not really there yet and doesn't look like it will get there
- andy_ppp 6y agoI think most packages are just as good if not better than their Ruby equivalents these days (and really we can do all of the things you mentioned in elixir), the active record pattern is obviously easier to understand than Ecto, but if you know how to write well optimised SQL you never want to go back to an ORM (even if it tries to rewrite your queries for you with magic).
- anhari 6y agoActiveRecord and the scenic gem for database views is a very powerful combination. For the vast majority of queries, you don't need to write optimized SQL by hand. When you do, you can push that work to a version controlled database view, and wrap it in a ActiveRecord class interface and still get all of the ORM niceties.
- andy_ppp 6y agoThe difference here is between two different philosophies: 1) I want the thing to just work, it doesn't matter about underlying complexity, give me the magic and the version controlled database view and the ORM niceties. 2) I don't trust magic as it has bitten me in the arse before, let me make and be able to fix things myself as I'm working at a (slightly) lower level. I'm not saying either is correct but in Phoenix/Elixir magic stuff tends to be kept to a minimum. One man's "for the vast majority of queries" is another persons "will work fine until you need to do something complex". It's all trade offs and I choose mine carefully as I'm sure you do.
- realusername 6y agoWhat I love with Phoenix/Elixir is that there's plenty of features I wouldn't bother with in a more traditional language. You want a PubSub? It's just there, you can use it in one line. You want a Redis? Registry is there, also in one line. It's like a whole tech stack in one language.
- jamil7 6y agoI saw a presentation about Phoenix/Elixir that described this once and it really impressed me. It's been 4 or so years that I've been meaning to pick up Phoenix for a project but still haven't.
- vram22 6y agoWas it a publicly available online presentation? If, please share title or link if you can.
- realusername 6y agoYou can watch this small twitter demo: https://www.youtube.com/watch?v=MZvmYaFkNJI https://www.youtube.com/watch?v=MZvmYaFkNJI. It's what sold me on the technology.
- vram22 6y agoThank you.
- jamil7 6y agoIt was a slide from a conference I believe but I wouldn't know how to find it - some elixir people in the thread might know. It was something illustrating all the external tools you'd normally reach for and how Erlang/Elixir just had all of this built into the language and VM.
- sfusato 6y agoThat sounds like one of Saša Jurić's talks: GOTO 2019 • The Soul of Erlang and Elixir • Saša Jurić https://www.youtube.com/watch?v=JvBT4XBdoUE https://www.youtube.com/watch?v=JvBT4XBdoUE https://elixirforum.com/uploads/default/original/2X/a/a2524cd7c485fc4d63c09c19f97821afb6343ec5.png https://elixirforum.com/uploads/default/original/2X/a/a2524c... (also from Saša Jurić's book)
- nickjj 6y ago> Phoenix and Elixir, if you understand the choices made, is also a wonderful choice Until you want to integrate Stripe, BrainTree, PayPal or Paddle and then you can't find an official library for Elixir. Even common things like pagination isn't fully solved with well maintained libraries in Elixir. Then there's things like wanting to create notifications (showing unread icons, sending email / sns notifications, etc.) where Rails has this solved with well supported gems but there's nothing like this in Elixir. There's dozens of other things too, and all of this adds up to you having to be an expert in Elixir and have to write all of this functionality from scratch. If you're in it for the long haul and are investing years into the project with a big team that's fine, but if you're a solo developer building an app and want to focus on writing your app's features, in my opinion Phoenix can't really be compared to Rails. Especially with Hotwire Turbo being recently announced, now you can get all of those awesome real time features into a Rails app quite easily (IMO even easier than Live View). I started a SAAS app with Phoenix a while back and ultimately backed out of it because all of the above. It just felt like I was in a perpetual state of having to write libraries instead of my application. It was one of those things where I got super excited initially but after 2 years of trying, waiting for certain features to come, etc. it ended up not being for me. I have no regrets tho because I learned a really big lesson from that, which is if you want to build something now, use whatever tech stack you know right now and if you're very much inclined to deviate from that and learn something new then pick something based on what exists today in that tech stack. Not what's "on the horizon" or "coming soon". You could set yourself up for waiting forever, or if that feature you wanted in the future does come out it could be way different than what was originally claimed and now it feels like you've delayed what you wanted to do for so long for nothing. In other words, nothing is ever going to be perfect. Just pick something and build it. Also trust what folks do, not what they say.
- andy_ppp 6y agoI think often the things that don’t exist are not there for good reasons... using Stripe’s api for example from a module is pretty trivial in my experience, it’s just HTTP and you don’t need to be super clever about it. What specifically are you struggling to paginate, I’ve never found that difficult to implement even with quite clever options. Again notifications doesn’t sound particularly difficult and I don’t see why I’d want to rely on some complex gem that does every option when I don’t need them. Elixir+Phoenix I agree is definitely lower level but there are things it does much better than Ruby on Rails. I’d rather not have to rely on gems and write the simplest implementation specifically for my use case. It’s a trade off, but one I’m much happier with.