node.js ExpressJS 与 MeteorJS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26942415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ExpressJS vs MeteorJS
提问by ShiviRox
I'm caught in a fix. I've learned ExpressJS to develop a web app and I'm a quarter of my way done. Then comes along Meteor which was very recently released. It has gotten a lot of press, funding and it has the benefit of being able to port to Cordova. Now I'm not sure whether to stick to ExpressJS or transition to Meteor.
我陷入了困境。我已经学会了 ExpressJS 来开发一个网络应用程序,我已经完成了四分之一。然后是最近发布的 Meteor。它获得了大量媒体和资金,并且具有能够移植到科尔多瓦的好处。现在我不确定是坚持使用 ExpressJS 还是过渡到 Meteor。
Key Points: Scalability, Ease of use, Development efficiency
关键点:可扩展性、易用性、开发效率
回答by OneSneakyMofo
Express = MVC Framework built in Javascript and is powered by Node.
Express = MVC 框架内置于 Javascript,由 Node.js 提供支持。
Meteor = Full Stack that has the front-end and back-end components to build a real-time application.
Meteor = Full Stack,具有构建实时应用程序的前端和后端组件。
To create the same implementation of Meteor using Express, you need to look at the MEAN stack, which includes MongoDB, Express, AngularJS, and Node. You can create the same thing in Meteor that you can with the MEAN stack, you are just going to be doing a lot more learning especially with AngularJS. Express and Angular are taken care of in Meteor using Meteor's template system and Blaze.
要使用 Express 创建相同的 Meteor 实现,您需要查看 MEAN 堆栈,其中包括 MongoDB、Express、AngularJS 和 Node。您可以在 Meteor 中创建与使用 MEAN 堆栈相同的东西,您将需要做更多的学习,尤其是使用 AngularJS。Express 和 Angular 在 Meteor 中使用 Meteor 的模板系统和 Blaze 处理。
I would stick with Meteor. It still has a few drawbacks, but there are workarounds. It's amazing what you can throw together in little time.
我会坚持使用 Meteor。它仍然有一些缺点,但有解决方法。您可以在短时间内拼凑出的东西真是太神奇了。
回答by Mário
You're comparing oranges with potatoes. Expressjs is backend and Meteor is fullstack, such a comparison is unfair at all!
你在比较橙子和土豆。Expressjs 是后端而 Meteor 是全栈的,这样的比较根本不公平!
I've been working with Meteor since 0.8 and I suffered in the skin the pain of upgrading, removing old vital third party packages, etc. you get the idea. Although Meteor reached 1.0, I don't think that the mobile component is quite ready, check github issues on it.
我从 0.8 开始就一直在使用 Meteor,我忍受着升级、删除旧的重要第三方软件包等的痛苦。你明白了。虽然 Meteor 到了 1.0,但我认为移动组件还没有完全准备好,查看 github 问题就可以了。
I think Meteor is ready for building online platforms. If you find that it doesn't play well in the mobile, you can still maintain your Meteor application and create an API on top of it, you can find packages on atmospherejs.com for it (or even use iron:router). That's what you would with Expressjs: create an API to be used by mobile devices.
我认为 Meteor 已准备好构建在线平台。如果您发现它在移动设备中表现不佳,您仍然可以维护您的 Meteor 应用程序并在其上创建一个 API,您可以在大气js.com 上找到它的包(甚至使用铁:路由器)。这就是您使用 Expressjs 所做的:创建一个供移动设备使用的 API。
About your Key Points of Meteor: Scalability - It's possible to scale Meteor although you won't a good article about it but if you take a look at Kadira, Arunoda managed to scale it. Ease of use - It's fairly easy to write a Meteor application in the beginning but in the long run you'll face some problems like I faced. Development efficiency - My experience in team wasn't that positive, we had bad architectural design choices and some bugs because new developers (even experienced ones) don't get Meteor, example: Instead of using Collections allow and deny rules, they use Meteor.methods for everything which doesn't translate to security. Some even publish the entire database to the client and say: Works great on my localhost :D
关于 Meteor 的关键点:可扩展性 - 虽然你不会写一篇关于它的好文章,但可以扩展 Meteor,但如果你看看 Kadira,Arunoda 设法扩展它。易于使用 - 开始时编写 Meteor 应用程序相当容易,但从长远来看,您将面临一些像我所面临的问题。开发效率 - 我在团队中的经验不是那么积极,我们有糟糕的架构设计选择和一些错误,因为新开发人员(甚至是有经验的开发人员)没有使用 Meteor,例如:他们使用 Meteor 而不是使用集合允许和拒绝规则.methods 适用于所有不会转化为安全性的东西。有些人甚至将整个数据库发布到客户端并说:在我的本地主机上工作得很好:D
About express: I have little experience on it but the comparing it with Meteor, it's not fair at all. Meteor doesn't not the same purpose as Expressjs.
关于express:我对它的经验很少,但与Meteor相比,它根本不公平。Meteor 与 Expressjs 的目的不同。
A comparison with MEAN Stack would make much more sense: http://mean.io/
与 MEAN Stack 进行比较会更有意义:http: //mean.io/
回答by imslavko
Express.js is quite different from Meteor.
Express.js 与 Meteor 完全不同。
Meteor tries to give a good framework for everyone taking a lot of decisions (hopefully good decisions) those are usually uninteresting from the application development point of view: what transport library to use, how to synchronize data, how to build a reusable API, security, CRUD operations with the database, etc.
Meteor 试图为每个人提供一个很好的框架,让他们做出很多决策(希望是好的决策),这些决策从应用程序开发的角度来看通常是无趣的:使用什么传输库,如何同步数据,如何构建可重用的 API,安全性, 与数据库的 CRUD 操作等。
Instead Meteor gives you a unified experience across the stack. Since it has so much power control over backend, transport, interfaces, front-end, build tool chain - it can build a lot of neat features those would be so much harder to glue together from Mongo+Express+your favorite front-end framework+socket.io+grunt/gulp.
相反,Meteor 为您提供了跨堆栈的统一体验。由于它对后端、传输、接口、前端、构建工具链有如此多的权力控制——它可以构建许多整洁的功能,这些功能很难从 Mongo+Express+你最喜欢的前端框架粘合在一起+socket.io+grunt/gulp.
Read Socket.io's creator's blog on how hard it is to deliver good user experience in single-paged apps these days: http://rauchg.com/2014/7-principles-of-rich-web-applications/. Meteor does a lot of it +more. (except for the server-side rendering and predictions, at least right now).
阅读 Socket.io 创建者的博客,了解如今在单页应用程序中提供良好的用户体验有多难:http: //rauchg.com/2014/7-principles-of-rich-web-applications/。流星做了很多+更多。(除了服务器端渲染和预测,至少现在是这样)。
Think about how many security holes you will have if you pick the abstractions too low level in hope to implement everything right.
想想如果您选择太低级别的抽象以希望正确实现一切,您将有多少安全漏洞。

