TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

CRUD: Node vs. Rails

2 点作者 rlf超过 13 年前
If one is building a CRUD/BASE website to be used on both mobile and desktop browsers, which would be the best framework to use on the server side, Rails or Node?<p>I'm building the site to serve a niche segment of the social dating marketplace. It will be profiles, email, a lot of uploading and viewing of pictures. I want my users to primarily access the site through mobile devices but there will be a desktop version as a fall-back. The major sites in this space have a lot of customers but don't seem to be keeping up with the times. Go to any of them and you'll think you've gone back in time seven years. They've also all been very slow to get on the mobile bandwagon. As for me, up until three years ago I was a web developer. I'd started out as a Unix sys-admin before moving on to web development with ColdFusion and then ASP.NET (I hate Microsoft technologies but that's what my company used.). I learned just enough JavaScript to get by. More recently I've read the "pickaxe" book and a couple of Ruby books and I must say I like Ruby a lot.<p>My biggest concern is that speed, which has never been Rails's strong suit, is critical for mobile users. My thought was that even if Node wasn't built with CRUD/BASE apps in mind, if you can still create such apps with Node, why not use it and eliminate that worry right off the bat? Second, both Rails and Node will have steep learning curves. If I'm going to invest a lot of time in learning a framework, why not learn Node and get in near the "ground floor?" Knowing it will also give me the flexibility in the future to build real-time social apps that RoR isn't suited for.<p>Ruby/Rails Pros: - More mature technology - Great community - Faster development time due to "convention over configuration" - A lot of books, blogs, etc. on Ruby on Rails - I like Ruby<p>Ruby on Rails Cons: - Blocked threads and GC can impact performance and require more infrastructure (= more $) - Less flexibility due to "convention over configuration" - Configuring servers appears to be challenging at times<p>Node Pros: - Performance shouldn't be an issue - One language (JavaScript) on both client and server - Growing and enthusiastic community<p>Node Cons: - Better suited for real-time apps that require a persistent browser/server connection than for CRUD apps - Event-based will require learning curve - Not 1.0 yet so libraries, etc. will be changing a lot - Frameworks (like Express) are less mature than Rails - Less documentation and just a couple of books (more coming) - I don't hate JavaScript but it seems somewhat "ugly" compared to Ruby

3 条评论

clyfe超过 13 年前
I would probably choose Rails, it gives reasonably more chances to reach the finish line successfully and with less problems, and the "speed downside" is not an issue (see all big websites like Hulu/Basecamp etc). There are also mature solutions to common problems via gems (Devise, CanCan, Omniauth, CarrierWave, ActiveScaffold, Ancestry etc) that get you to the finish line even faster. And programming synchronously is a lot easyer .<p>There is little reason to use Node unless you do realtime stuff or you foresee concurency issues, and even so, there are alternatives like EventMachine. (The Node ecosystem is maturing, there are packages like Everyauth and such, nevertheless I would choose Rails)
SoftwareMaven超过 13 年前
I would choose Rails as well. You will spend more time than you remotely expect working with node (for all the reasons you mention...they really do add up), and an unfinished app, no matter how fast, is useless to your users.
评论 #3563784 未加载
fauzias超过 13 年前
You are comparing something which doesn't placed to be compared, nodejs are plainly a language, if you compare nodejs, you shall compare it with ruby instead. if you want to compare rails, try compare it with a framework build on nodejs instead, something like expressjs or my favourable railwayjs.com
评论 #3512541 未加载