3 ms·
Lots of downvoting but I mean duhh for the average app and average developer of course Rails > Erlang is this even a discussion? Anything from documentation, co
by joelbluminator 5y ago
Lots of downvoting but I mean duhh for the average app and average developer of course Rails > Erlang is this even a discussion? Anything from documentation, community size, Stackoverflow questions to libraries will be better with Rails.
Ah but the comments now say that Erlang = Elixir actually. Ok, I didn't know that.
I'd say the same thing though, Rails > Elixir for the average app. You don't need the extra complexity Elixir brings. Yes I know about Whatsapp; no you're not gonna be Whatsapp.
- weatherlight 5y agoas a person who knows and works both, Elixir/Phoenix and Rails. Elixir/Phoenix is dead simple. Theres no "Rails Magic." It's easy to understand what's happening at all times. You don't need to have a grasp of the internals of OTP because it's not that important for the problem described above, but it's there should you need it, wand why you do need it you just need to understand it instead of of a plethora of extra technologies/DSLs that you would with a regular Rails Application. with Rails you need to know/consider technologies like Foremen, Webpacker, Redis, Capistrano(or what ever), AnyCable or ActionCable, Sidekiq or whatever for ActiveJob, then how Puma(Unicorn, Thin) Webservers work, you probably need NgineX or something like it for reverse proxying. For more Rich Frontend experiences, something like Stimulus Reflex or a JS Spa(angular, react, svelte) Cron for periodic task, even stuff like periodically restarting your application. These are things you don't have to necessarily worry about in the context of Elixir & Phoenix w/ Liveview.
- joelbluminator 5y agoYou're just listing a bunch of tech here that probably many Elixir apps use. None of it is essential for Rails btw.
- weatherlight 5y agoI'm listing the things I've used over the last 9 years of developing SaaS platforms in Rails. The beautiful thing about Elixir/OTP in general, is because you can approximate all those things that I listed above with OTP and core Elixir/Erlang libraries. You can't do that with rails, you need those other libraries/technologies/DSLs etc.
- joelbluminator 5y agoHow do you "approximate" stuff like retrying failed jobs and persisting them to disk then? You use whatever the Elixir community came up with which is Oban that uses PG or Exq that uses redis. Sure hobby projects won't need an actual queue. You don't need Sidekiq for toy projects as well with Rails simply use the memory store, it can take you pretty far.
- weatherlight 5y agoliterally on the Exq github readme: https://github.com/akira/exq#do-you-need-exq https://github.com/akira/exq#do-you-need-exq "While you may reach for Sidekiq / Resque / Celery by default when writing apps in other languages, in Elixir there are some good options to consider that are already provided by the language and platform. So before adding Exq or any Redis backed queueing library to your application, make sure to get familiar with OTP and see if that is enough for your needs. Redis backed queueing libraries do add additional infrastructure complexity and also overhead due to serialization / marshalling, so make sure to evaluate whether it is an actual need or not. Some OTP related documentation to look at: GenServer: http://elixir-lang.org/getting-started/mix-otp/genserver.html http://elixir-lang.org/getting-started/mix-otp/genserver.htm... Task: https://hexdocs.pm/elixir/Task.html https://hexdocs.pm/elixir/Task.html GenStage: https://hexdocs.pm/gen_stage/GenStage.html https://hexdocs.pm/gen_stage/GenStage.html Supervisor: http://elixir-lang.org/getting-started/mix-otp/supervisor-and-application.html http://elixir-lang.org/getting-started/mix-otp/supervisor-an... OTP: http://erlang.org/doc/ http://erlang.org/doc/ If you need a durable jobs, retries with exponential backoffs, dynamically scheduled jobs in the future - that are all able to survive application restarts, then an externally backed queueing library such as Exq could be a good fit. If you are starting a brand new project, I would also take a look at Faktory. It provides language independent queueing system, which means this logic doesn't have to be implemented across different languages and can use a thin client such as faktory_worker_ex."
- cultofmetatron 5y ago>Foremen, Webpacker, Redis, Capistrano(or what ever), AnyCable or ActionCable, Sidekiq or whatever for ActiveJob - Formen: thats just a process manager. you need somethign for otp as well. in my startup, its booted up from kubernetes. the nice thing is that the vm will use all available cpus. - Webpacker: phoenix comes with webpack out of the box though I think they are replacing that in the next version with esbuild. - Redis: Elxir borrows from the beam and part of that includes both an in memory ets (key balue storage system) and mnasia (a slightly more sophisticated queriable database. ie: I don't need to setup redis when the virtual machine has something already avaialble. redis is there if you really want it though - Capistrano: We use kubernetes but theres also mix release which comes out of the box - AnyCable or ActionCable: have you heard of phoenix's channels system? its WAY more powerful. action cable is a toy compared to what the channels system can do and its already setup when you start a phoenix app. - Sidekiq or whatever for ActiveJob: Oban works great and I was able to set it up and use it from scratch within an hour
- joelbluminator 5y agoTech is complicated, I don't think Elixir really lowers the bar in terms of understanding stuff like deployment to a basic level, docker, some persistance (I assume redis IS used quite a lot despite what you are suggesting here), reverse proxies like NGINX, CDNS etc etc. AnyCable is written in Go last I checked btw, what makes you think Elixir has something more performant? Never really bothered with it, it's not like every company I work for needs to push messages to millions of people at once all the time.
- cultofmetatron 5y ago> AnyCable is written in Go last I checked btw, what makes you think Elixir has something more performant? https://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections https://www.phoenixframework.org/blog/the-road-to-2-million-...