Stimulus Discourse

Any experience in cost of scaling Stimulus/Turbolinks?

Heavier front-end Javascript frameworks (React, Angular, Vue, etc) offload some work that servers might normally do in rendering a UI. They connect to an API, download JSON and then perform business logic on rendering a UI, handling interactions, etc.

While you could do this with Stimulus/Turbolinks, it seems this framework prefers to push the business logic to the backend.

Has anyone seen or had issues with scaling large applications using this? Is the difference negligible, or is it more expensive because you have to put more server power into scaling? Do you need to be more aggressive with backend caching (which can cause other issues)?

Thoughts?

Servers (and frameworks like Rails, with its refined caching strategies) are highly optimized for building HTML and serving it to browsers. If you’re not sending a megabyte of graphics on your sub-page update, the trade-off between hosting an entire JSON->HTML converter in the browser and just letting the browser do what it was born to do (along with only sending the changed parts of the page) can make this a win for Turbolinks. This will always depend on the exact architecture of your application. But for me, for the kind of work I do, I would never want to build the same app twice, maintain state in two places, and perform authorization in two places if I could avoid it.

Walter

I appreciate the explanation of the perspective of Turbolinks/Stimulus approach. I’m hoping to find more info on developers experience in server impact.