
Ruby’s Rack Push: Decoupling the real-time web application from the web - ksec
https://bowild.wordpress.com/2018/05/01/rubys-rack-push-decoupling-the-real-time-web-application-from-the-web/
======
pmontra
A separate websocket server is a huge pain in any language. A great feature of
Phoenix for Elixir is that the webserver and the websocket server are in the
same process tree.

I'll try this new approach for Ruby and see how it scales.

~~~
jkarneges
I agree separate servers can be a pain, especially in a development
environment. But I also believe separate servers can be a useful architecture
in production, regardless of whether the web framework being used is thread-
per-connection or event-driven.

Using separate servers can make it possible to upgrade/restart the backend
process without necessarily disconnecting clients. It can allow
managing/scaling the front tier separately from the back tier, which can make
sense if you already do this for your request/response stuff (e.g. cache tier
separately managed/scaled from web service tier). It's also a sane way to
manage long-lived connections from a function backend like AWS Lambda, so the
function doesn't have to run for the entire duration of a connection.

I created Pushpin ([https://pushpin.org](https://pushpin.org)) to attempt to
standardize this split-process architecture for all languages. It is a bit of
a pain in a development environment, but a lot of fun in production. :)

~~~
qaq
You bring up a lot of important points none of which apply to Elixir/Phoenix.
In Erlang/Elixir world you can even live upgrade a running system to a new
release without restart.

~~~
jkarneges
Can you really live upgrade an Erlang process without disconnecting TCP
connections it is using? If so that's really interesting, would be curious to
learn more.

~~~
jimktrains2
I'm not familar with Erlang, but applications like HAProxy don't upgrade the
process in use, but only new connections.

~~~
wlll
May be of interest:
[https://news.ycombinator.com/item?id=10669131](https://news.ycombinator.com/item?id=10669131)

------
lazyloop
One of the reasons i really like Perl is Mojolicious. Thanks to it we don't
need separate servers for websockets and HTTP anymore.
[https://mojolicious.org](https://mojolicious.org)

~~~
vgy7ujm
Mojolicious rocks!

------
33degrees
Interesting: I wasn't aware of the two servers mentioned in the article, looks
like it's time to try out a new stack!

------
diminish
It's the first time I hear about new web servers in Ruby after thin,
passenger, unicorn, puma. Anyone has real life applications with Rails/Sinatra
on iodine or agoo?

~~~
haffla
First time I hear about them, too. Googling Rails + Iodine doesn't yield much
information. I'm going to try replacing Puma in one of my Rails apps. The
benchmarks suggest that this could be a real win.

~~~
haffla
I'm on third place in Google for "rails iodine" now, lol

