Re:Ruby concurrency is hard: how I became a Ruby on Rails co...
by quickthrower2 on Thursday November 24, 2022 @04:52AM
(#33729484)
What is presence awareness?
Re:Ruby concurrency is hard: how I became a Ruby on Rails co...
by grncdr on Thursday November 24, 2022 @05:28AM
(#33729710)
I will just steal the first paragraph from https://hexdocs.pm/phoenix/presence.html, but you can read much more about it there.
> Phoenix Presence is a feature which allows you to register process information on a topic and replicate it transparently across a cluster. It's a combination of both a server-side and client-side library, which makes it simple to implement. A simple use-case would be showing which users are currently online in an application.
Re:Ruby concurrency is hard: how I became a Ruby on Rails co...
by quickthrower2 on Thursday November 24, 2022 @02:07PM
(#33735094)
I see! Funny enough the app of the company I work for does this. The tech is simply running a stateful server behind the web server.
Re:Ruby concurrency is hard: how I became a Ruby on Rails co...
by cpursley on Thursday November 24, 2022 @07:35AM
(#33730596)
All those things you listed required additional background servers, redis, etc. In Elixir/Erlang, it's built into the runtime which is a huge advantage. And even with standard things like handling http requests - Elixir absolutely smokes Ruby.
Re:Ruby concurrency is hard: how I became a Ruby on Rails co...
by silasb on Thursday November 24, 2022 @09:59AM
(#33731998)
Those built-ins that you are talking about are not as well rounded as a dedicated framework. These built-ins operate at a different operating model than running additional background servers. This typically means that everyone in the org needs to be an Elixir/Erlang expert instead of having experts in Redis, cloud native, ... For better or worse, this is likely a large obstacle for many orgs.
The argument for using Elixir/Erlang is also more difficult when you have large companies like Github and Shopify demonstrating that Ruby can scale.
EDIT:
Let's not forget that it's mostly the DB that slows CRUD apps down. Not the language or the framework.
Re:Ruby concurrency is hard: how I became a Ruby on Rails co...
by grncdr on Thursday November 24, 2022 @12:30PM
(#33733901)
No, they don't. You can absolutely run ActionCable on Rails + Postgres with no additional services.
Re:Ruby concurrency is hard: how I became a Ruby on Rails co...
by cpursley on Thursday November 24, 2022 @04:06PM
(#33736232)
I'm using Quantum as my job runner in Elixir. Doesn't require even Postgres. Can't do that in Rails or other stacks:
https://github.com/quantum-elixir/quantum-core
^ obviously it won't fit every use case (where you need 100% durability) but for that there's Oban which is awesome:
In my experience a bog-standard vanilla Rails + Postgres setup provides all of the things you mentioned (except presence awareness, which is pretty tricky).
* Server push. Websockets. Push notifications. => ActionCable
* Scheduled jobs. Long running background jobs. => ActiveJob
* Calls into other services. => Pick your preferred HTTP library (or just use Net::HTTP)
All of the above have been part of Rails for years. The only additional Gem I would add is good_job to be the ActiveJob backend.
Now, if you start to bump up against what vertically scaling Postgres can handle, or you want some of the _additional features_ of a 3rd party dependencies (Redis, Sidekiq, Webpack, etc. etc.) you can easily add them, but it's realllly unnecessary for 99% of apps out there.