News for hackers. Stuff that matters.
Re:Hotwire: HTML over the Wire by elamje on Tuesday December 22, 2020 @11:52AM (#25508292)
This is the Ruby on Rails version of what Elixir Phoenix Live View and .NET Blazor do.

For those not familiar, rather than using a standard web framework where a lot of processing is done client side, these frameworks allow html buttons etc to call native Ruby, C#, or Elixir functions on the server rather than using some sort of post/get request to do that. Every UI interaction goes over the wire, which is where performance can be hurt.

Having used Blazor in production for nearly a year, it speeds up development, but your server is doing a lot more processing and will not be able to handle an equivalent amount of users that a normal web app would because it’s keeping a copy of the clients DOM in memory. It’s updates the dom on the server then streams that update through websockets to the clients dom, creating your magic Single Page App experience.

I think it’s cool tech, but not necessarily scalable due to the increased server load. I’d be interested to hear from people using it to serve large orders of magnitude of clients at once.

Re:Hotwire: HTML over the Wire by dhh on Tuesday December 22, 2020 @12:06PM (#25508468)
I get the rush to provide technical comparisons to something that was just revealed five minutes ago, but none of what you just said is actually how Hotwire or Turbo works. There's no client DOM in memory on the server, there's no html buttons that call native code.

There are forms being submitted, there are normal requests happening, there are templates being rendered on a per-request basis (just like a full page load).

This is like a normal web application that renders HTML, from the perspective of how the server works. Just as scalable as every other Rails application that renders HTML. Be that GitHub or Shopify or Zendesk or Basecamp or HEY or any of the many, many other apps that have long ago definitively proven that Rails Scales.

Although I do find the commentary that the current #1 comment on the HN thread is literally a "bUt DoES iT SCaLE??" take, based on a misunderstanding of how this works. All is indeed as it's always been

Re:Hotwire: HTML over the Wire by aomega08 on Tuesday December 22, 2020 @12:20PM (#25508653)
Hi @dhh!

Loving the tech and the website (and Rails, and Basecamp, etc). However it looks very similar to StimulusReflex (https://stimulusreflex.com), which has already attracted a few users.

Can you highlight the biggest differences between the two?

Thanks!

Re:Hotwire: HTML over the Wire by OJFord on Tuesday December 22, 2020 @12:51PM (#25509036)
Looks like link should be https://docs.stimulusreflex.com/ (the root domain you linked doesn't go anywhere).
Re:Hotwire: HTML over the Wire by ksec on Tuesday December 22, 2020 @12:53PM (#25509065)
And while we are at it, Motion (https://github.com/unabridged/motion)
Re:Hotwire: HTML over the Wire by saltcod on Tuesday December 22, 2020 @12:37PM (#25508876)
Literally LOL'd at the first part of this. A+++.
Re:Hotwire: HTML over the Wire by aantix on Tuesday December 22, 2020 @01:08PM (#25509232)
It's not keeping a copy of the DOM server-side..

That's not how it works, at all.

Re:Hotwire: HTML over the Wire by progressbwc on Tuesday December 22, 2020 @02:00PM (#25509809)
I can’t speak for Blazor but LiveView does not keep a DOM on the server nor it requires all UI interaction to go to the server.
Re:Hotwire: HTML over the Wire by kfk on Tuesday December 22, 2020 @12:00PM (#25508402)
It depends right? If your app is a dashboard this could be less work when using smart cashing. You could cache entire html fragments on the server for specific user defined filter values. If you are serving hundreds of users you’d have dashboard faster than most BI tools out there including PowerBI.
Re:Hotwire: HTML over the Wire by BryanBeshore on Tuesday December 22, 2020 @11:56AM (#25508347)
Any idea how many people use Hey.com? That might be an early indication as to how scalable this is (at least for hotwire's concerns)
Re:Hotwire: HTML over the Wire by ksec on Tuesday December 22, 2020 @01:03PM (#25509180)
Well Rails was never not scalable in literal sense. It was just the cost of scaling being expensive; comparatively speaking when people say Rails not able to scale. And for most if not all SaaS that should never be much of a problem. Because you are getting revenue per user, and generally speaking the cost percentage of user / app / server resources is so small, that is a rounding error in grand scheme of things.

What doesn't work quite as well is when the app is operating a freemium / ad based model. Where a large volume of traffic are required before you start generating revenue.

Re:Hotwire: HTML over the Wire by SkyPuncher on Tuesday December 22, 2020 @04:00PM (#25511182)
I always find the Rails/scalable thing to be a funny argument - especially on the startup-minded HN.

You don't need scale at a startup. You need velocity. If you're hitting scale at a startup, you've done one of two things:

* Written absolutely terrible software

* Succeeded

Unless you've hit the second one, it will almost always be cheaper to simply spin up another server.

Re:Hotwire: HTML over the Wire by EdwinLarkin on Tuesday December 22, 2020 @04:33PM (#25511506)
Could be because a lot of startups are just trying to squeeze just as much traffic as they can with very little capital involved.

It's basically here's my app that does billions of things and wants billions of users and runs on potato thing.

Re:Hotwire: HTML over the Wire by simonw on Tuesday December 22, 2020 @12:42PM (#25508938)
GitHub scales just fine on their own variant of Turbolinks.
Re:Hotwire: HTML over the Wire by BryanBeshore on Tuesday December 22, 2020 @12:58PM (#25509131)
Agreed. My comment about scaling is simply that a lot of other companies use rails at scale, and alike that of hey.com (which I presume is heavily used) it is probably built to... scale