NodeJS 与大型项目的 Play 框架
我真的在构建大型应用程序的两个不同堆栈之间左右为难。一方面有这个选项:
- Node.js
- 快递
- 咖啡脚本
- 喝咖啡
- 猫鼬/mongodb 或
- presistencejs/mysql
- 使用 Scala 的 Play 框架
- 使用 mysql 进行异常
- 或 mongodb
Node.js 路径对我很有吸引力,因为我可以在我已经知道的 CoffeeScript 中编写所有服务器端代码、视图和客户端代码。如果我走这条路,我仍然不能 100% 确定我会采用哪条数据库路径。 mongoose 使得存储数据变得快速而简单,但是考虑到我所考虑的数据模型(非常 SQLish),缺乏真正的关系可能会更难以处理。
Play Framework 路径也很有吸引力,因为我在使用 Java 时很了解该框架,但我对 Scala 不太了解,所以当我学习该语言时,生产力会受到影响。 Anorm 数据库访问层很有吸引力,因为我可以手动编写我喜欢的 SQL,并将结果自动映射到对象,这节省了很多精力。
我一直倾向于 Node.js,但我并不认同最好的数据库访问层。任何人都有这方面的经验并可以分享一些见解吗?
I am really torn between two different stacks with which to build a large application. One the one hand there is this option:
- Node.js
- express
- coffee script
- coffeekup
- mongoose/mongodb
or - presistencejs/mysql
- Play Framework w/ Scala
- Anorm w/ mysql
- or mongodb
The node.js path is appealing to me because i can write all of the server side code, views and client side code in coffeescript, which i already know. If i go down this road i am still not 100% sure which db path i would take. mongoose makes storing data quick and easy, but the lack of true relationships might be more difficult to work with given the data model i have in mind (very SQLish).
The Play Framework path is also appealing because i know the framework well when using Java, but i don't know much about Scala, so there would be a hit to productivity as i work through learning that language. The Anorm database access layer is appealing because i can write the SQL by hand which i would prefer, and have the results mapped to objects automatically, which saves a lot of effort.
I keep leaning towards node.js, but i'm not sold on the best db access layer to use. Anyone have any experience with any of this and can share some insight?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您选择的堆栈应取决于应用程序的需求。让我们看看 Play 与 Node 的优势:
Node
玩吧!
如果您的应用程序Play 更接近传统的基于网络的模型,可能是您的最佳选择。如果您需要即时反馈和实时动态消息传递,Node 是更好的选择。
对于大型传统应用程序,请认真考虑 Play!框架由于内置的单元和功能测试以及数据库迁移。如果将其纳入开发过程中,这些对于最终产品按预期工作、稳定且无错误大有帮助。
The stack you choose should depend upon the needs of your application. Let's look at Play vs. Node for their strengths:
Node
Play!
If your application more closely matches a traditional web-based model, Play is probably your best choice. If you need immediate feedback and real-time dynamic messaging, Node is the better choice.
For large traditional applications, seriously consider the Play! Framework because of the built-in unit and functional testing along with database migrations. If incorporated into the development process, these go a long way toward an end product that works as expected and is stable and error-free.
在比较 Web 框架时,您应该考虑 10 个主要类别:
请查看我的演讲 Node.js 与 Play 框架,详细了解如何使用这两个框架在这 10 个维度上进行比较。
There are 10 major categories you should consider when comparing web frameworks:
Check out my talk Node.js vs Play Framework for a detailed breakdown of how these two frameworks compare across these 10 dimensions.