Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> You can do this with Next.js SSR

Yep! It'd be possible with Next.js. The difference is how it's organized. In Next.js with RSCs, we were fetching data for each part of the page where it's used (trending books, Live events, blog posts, favorite books). Each of those could be their own cache hit to Redis.

One advantage of Rails is the controller. We can fetch all data in s single cache lookup. Of course it'd be possible to put everything needed in a single lookup in Next.js too, but then we wouldn't be leveraging RSCs.

I tried self-hosting Next.js on Digital ocean, but it crashed due to memory leaks without a clear way to understand where the leak was. Google Cloud Run and Vercel worked because it would restart each endpoint. We have more (and cheaper) hosting options with Rails.



This is my exact criticism of RSCs, they basically encourage the N+1 query problem. Basically nobody should be organizing their data fetches like this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: