by nikodunk · 4y ago · 0 comments
Trying out rails, I understand how much magic is involved here. Because I've had to build all this crap myself - many, many times over. Complicated things become simple, and tasks that usually make me sigh (add a new data point and add it right through Knex, Hapi models, routes, redux actions, redux store, dispatch/selector and template) turns into a SINGLE COMMAND. Sold :)
Very excited about this new release!
Edit: I wrote a blog about this a while ago btw, but there are many others pieces out there like it: https://nikodunk.com/a-node-js-developer-discovers-rails/ - using it to create https://electrade.app currently.
JavaScript (even with TypeScript) and frontend frameworks are…quite a journey by comparison.
I would argue that the performance hit isn't from ruby or the framework, but from people abusing the database with lazy loading in active record. Force people to fetch all the data they need in one query (similar to Ecto), and your performance will improve. There's some config value that disables lazy loading too
That said, it is also quite slow when you actually do need requests per second or rows per second, but the usual thing is to throw more machines at it,reduce the amount of magic in the hot path (like activerecord-import for bulk data if that's still maintained,) or use something else for the hot path.
I see so much focus on this on web frameworks generally and it strikes me as almost always the wrong thing to optimise for.
I don’t know rails, the last time i tried it was circa 2007 and yet I’d confidently adopt it given the right situation.
If i had a choice between shipping features 2% sooner or saving $10k / year on server costs, I’d almost always choose sooner. Let’s be honest, a rails dev team is moving more than 2% faster than a java/c# web dev team.
If i have 5 devs and they’re all 2% more productive, that could be around $10k of free developer output but it’s more than that, developer productivity compounds. 75% off my server costs doesn’t.
As someone who created their app in Next.js this year, I can tell you the Node.js ecosystem is in absolute shambles. We are making a WYSIWYG / ecommerce platform for authors, so we need the ability to make and preview live changes.
After finishing our MVP with a no-code solution, we decided to move to a custom Next.js app in as little time as possible. Big mistake. I had the urge to dig into Rails but I was much more comfortable in React. That being said, it's been a nightmare dealing with package upgrades, ESM vs CJS, running tests, adding Typescript, etc.
I believe, for example, creating the preview component would have been significantly faster in Rails than Next.js.
Recently we migrated to Next.js v12 for speed improvements. So many roadblocks. It took forever to debug. Again, mostly due to dependency resolution issues.
Blitz.js is supposedly going to be the Rails of JS but there is no way they'll ever have the support that either Next or Rails will receive.