简体   繁体   English

我应该使用Node.js而不是Rails用于实时WebApps吗?

[英]Shall I use Node.js Instead of Rails for Real-time WebApps?

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. 我正在构建一个复杂的Web应用程序,它必须使用实时数据并向用户显示数据。

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. 鉴于我已经习惯了Rails,我想知道转储rails并使用node.js来构建应用程序是否有很大的优势,或者如果有办法我可以在Rails中获得Node.js的实时优势。

Better would be to be able to use Node.js and Rails. 更好的是能够使用Node.js和Rails。 Is that a possibility? 这有可能吗?

Thanks 谢谢

Better would be to be able to use Node.js and Rails. 更好的是能够使用Node.js和Rails。 Is that a possibility? 这有可能吗?

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. 恕我直言,结合两全其美是一个非常好的主意,因为您可以使用您现有的经验来构建Web应用程序的“标准”MVC部分,并将node.js用于特定的基于实时的元素。 This can not only widen your skill set but you can also learn new techniques on how to solve various problems with appropriate tools. 这不仅可以拓宽您的技能,还可以学习如何使用适当的工具解决各种问题的新技术。

You should read this : Ruby on rails and Node.js 您应该阅读: Ruby on rails和Node.js

The answers of Shripad K and Andy Atkinson are greats ! Shripad K和Andy Atkinson的答案都很棒!

Node.js has a lot of advantages, but you do have to know what you're doing to take advantage of it's power. Node.js有很多优点,但你必须知道你正在做些什么才能利用它的强大功能。 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. 对rails的主要好处是Node.js比Rails更轻量级(它说了很多,IMO),并且支持更高的并发性。

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. 根据定义,Node.js涵盖了第一个。 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. 如果你想进入JavaScript事件驱动的世界,我当然建议你尝试一下。 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! 无论哪种方式,祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails 3:从Node.js / MongoDB向用户显示实时数据 - Rails 3: Show Real-Time Data to User from Node.js/MongoDB 使用Node.js实时读取文件 - Reading a file in real-time using Node.js 如何使用 Node.js 和 Firebase 制作实时列表 - How can I make real-time list using Node.js and Firebase 我应该如何理解和使用用Node.js编写的服务器? - How shall I understand and use this server written in Node.js? 如何使用履行部分中的Node.js接收实时数据库中的最新数据? - How do i receive the most recent data in Real-Time Database using the Node.js in the fulfillment section? Node.js中的异步查询是否有助于克服实时数据流中的延迟? - Do Asynchronous Queries In Node.js Help Overcome Latency In Real-Time Data Stream? 使用NowJS / Node.js实时跟踪在线/离线状态? - Keeping track of online/offline status in real-time with NowJS/Node.js? 如何在react-native中使用node.js和Socket.io实现实时聊天? - How to Implement real-time chatting using node.js and Socket.io in react-native? 没有Node.js的实时HTML5 Web应用程序 - Real-time HTML5 web application without Node.js 使用node.js从串行端口实时获取数据 - Real-time data acquisition from serial port with node.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM