我应该使用 Node.js 而不是 Rails 来实现实时 Web 应用程序吗?
我正在构建一个复杂的网络应用程序,该应用程序必须大量处理实时数据并向用户显示该数据。
鉴于我更习惯Rails,我想知道转储rails并使用node.js来构建应用程序是否有很大的优势,或者是否有一种方法可以在Rails中拥有Node.js的实时优势。
更好的是能够使用 Node.js 和 Rails。有这种可能吗?
谢谢
I'm in the process of building a complex web app that must work a lot with real-time data and showing that data to the user.
Given that I'm more used to Rails, I'm wondering if there's a big advantage of dumping rails and use node.js to build the app or if there's a way I can have the real-time advantages of Node.js in Rails.
Better would be to be able to use Node.js and Rails. Is that a possibility?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
恕我直言,结合两全其美是一个非常好的主意,因为您可以使用现有的经验来构建 Web 应用程序的“标准”MVC 部分,并使用 Node.js 来实现特定的基于实时的元素。这不仅可以扩大您的技能,还可以学习如何使用适当的工具解决各种问题的新技术。
IMHO combining the best of both worlds is a very good idea since you can use your existing experience to build "standard" MVC parts of your web application and use node.js for specific real-time based elements. This can not only widen your skill set but you can also learn new techniques on how to solve various problems with appropriate tools.
您应该阅读以下内容: Ruby on Rails 和 Node.js
Shripad 的答案K 和安迪·阿特金森太棒了!
You should read this : Ruby on rails and Node.js
The answers of Shripad K and Andy Atkinson are greats !
Node.js 有很多优点,但您必须知道自己在做什么才能利用它的强大功能。这通常需要一些时间。相对于 Rails 的主要好处是 Node.js 比 Rails 更轻量(在我看来,这说明了很多),并且支持更高的并发性。
尽管我觉得此时我应该注意一点,大量实时数据检索并不一定意味着您需要高并发性。这意味着您需要确保中间层和数据访问层非常快,并且可以处理吞吐量。根据定义,Node.js 涵盖了第一个。不管怎样,你所说的响应时间都是低毫秒的。
如果您想进入 JavaScript 事件驱动的世界,我当然建议您尝试一下。但对于不仅仅是一个“测试”项目(对于您的第一次尝试)的事情,我不知道它有多好。
不管怎样,祝你好运!
Node.js has a lot of advantages, but you do have to know what you're doing to take advantage of it's power. That usually takes some time. The primary bonus against rails is that Node.js is more lightweight than Rails (which is saying a lot, IMO), and supports higher concurrency.
Though I feel I should side note at this point that a lot of real-time data retrieval doesn't necessarily mean you need high concurrency. It means that you need to make sure your middle tier and data access tier are very speedy, and that you can handle the throughput. By definition, Node.js covers the first one. Though either way you're talking in low milliseconds for response times.
If you want to get in to the JavaScript event-driven world, I'd certainly recommend trying it out. But for something that's not just a 'test it out' project (for your first attempt), I don't know how good of an idea it is.
Either way, best of luck!