NIO网络服务器之间的比较

发布于 2024-10-06 18:45:53 字数 567 浏览 0 评论 0原文

我们需要在我们的架构中放置一个服务器,用于将内容流式传输到(可能)数百万部手机。

这里的架构师和运维人员只了解 Java,但我真的想提出一些更快、更容易维护的东西。

目前我的候选列表是:LiftNode.jsYaws

服务器应在验证用户凭据并向用户收费后提供静态内容(视频、游戏、XML 描述)。因此,还将使用 nosql 数据库(couchdb 或 mongodb)。

无需生成动态内容或 html。

纯粹的速度很重要,但不是唯一的参数,操作易用性也很重要。

从开发的角度来看,我真的很喜欢这三者,各有各的方式。

  1. 在其他条件相同的情况下,由于 Scala 和 Java 之间的兼容性,Lift 将是我的首选。
  2. 第二个是node.js,因为每个人都了解Javascript。
  3. Erlang 有点难学和难教,所以 Yaws 将是我的最后选择,尽管我个人喜欢它。

所以问题是:根据您的经验,您会向我推荐什么?也可能是另一个。

We need to put in our architecture a server for streaming contents to (potentially) millions of phones.

Here the architects and operations people know only about Java, but I'd really to propose something faster and easier to maintain.

My list of candidates currently is: Lift, Node.js, Yaws.

The server should serve static content (videos, games, xml descriptions) after authenticating user credentials and charging the user. So a nosql db (couchdb or mongodb) will be used as well.

No need to produce dynamic content or html.

The pure speed is important but not the only parameter, also operational ease to use is important.

From a development point of view I really like all 3 in their own way.

  1. All other things being equal Lift would be my first choice because of compatibility between Scala and Java.
  2. Second one is node.js because everybody understand Javascript.
  3. Erlang is a bit hard to learn and teach, so Yaws would be my last choice, although I personally like it.

So the question is: in your experience, what would you recommend me? Could be also another one.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

再见回来 2024-10-13 18:45:53

由于您的要求,很难进行比较,但我更喜欢节点。但话又说回来,对于你的要求,也许java更适合。

服务器应该提供静态内容
(视频、游戏、xml 描述)
验证用户凭据后
并向用户收费。所以一个nosql数据库
(couchdb 或 mongodb)将用作
好吧。

node.js is/was(3.x 更好地解决了这个问题)不太擅长处理大请求 =>观看 ryan dahls 关于大请求问题的路线图演讲 (从 35:36 开始你会看到一个不可接受的图表,两者都在 3.x 中得到解决)。

只能比较node和java,因为我没有任何使用erlang的经验。

  • npm 与 maven => npm 好多了。
  • Node.js 中的一些非常好的库以及 github.com 上一直创建的很多库。举几个例子:express、socket.io、npm、node_redis
  • 在node.js 中非常快速的原型设计。
  • 无论如何,如果进行网络编程,人们应该学习使用 javascript。
  • java 的 IDE 更好,但在 Node.js 中你需要输入的内容要少得多。您甚至可以使用coffeescript(也许zappa)。例如,我还喜欢 Netbeans 中的 Junit 集成与 IDE 中的 Node.js 单元测试支持(不存在?)。

difficult comparision because of your requirements, but I like node better. But then again for your requirements maybe java is a better fit.

The server should serve static content
(videos, games, xml descriptions)
after authenticating user credentials
and charging the user. So a nosql db
(couchdb or mongodb) will be used as
well.

node.js is/was(3.x solves this better) not so good at handling large requests => Watch this roadmap talk from ryan dahls about large requests problem(35:36 and onwards you see a diagram which is unacceptable, both is being solved in 3.x).

Can only compare node vs java, because I don't have any experience with erlang.

  • npm vs maven => npm much nicer.
  • some very nice libraries in node.js and a lot created all the time at github.com. To name some: express, socket.io, npm, node_redis
  • very fast prototyping in node.js.
  • People should learn to use javascript anyway if webprogrogramming.
  • IDE for java are much better, but you need to type much less in node.js. You could even reduce your typing by using coffeescript(maybe zappa). For example I also like the Junit integration in netbeans vs node.js unit testing support in IDE(non existing?).
再见回来 2024-10-13 18:45:53

认证和内容服务没有理由需要使用相同的技术。您可以对您喜欢的任何技术进行身份验证和计费,然后从支持非公共内容(Akamai、Cloudfront 或自定义身份验证/交付架构)的 CDN 中提供内容。

需求的两部分具有非常不同的潜在用途和不同的设计需求。

There is no reason why the authentication and the content serving need be the same technology. You can auth and bill on any technology you like and then serve the content out of a CDN that supports non public content (Akamai, Cloudfront, or a custom auth/delivery architecture).

The two halves of the requirements have very different usage potentially, and different design requirements.

绻影浮沉 2024-10-13 18:45:53

我会赞扬node.js,因为它非常快并且非常易于使用。或者你可以考虑针对 libevent 编写 C 代码...但是从上面的列表中我真的推荐 node.js

I would wote for node.js as it's very fast and very easy to use. Or you could look into writing C code against libevent... But from the list above I'd really recommend node.js

自控 2024-10-13 18:45:53

来自 Gabriele Lana(好朋友和杰出的开发人员)的私人电子邮件。


我的订单是:

  1. node.js - 关键字在这里很务实。我刚刚在 14 天内完成了一个使用 node.js+redis 的小项目,它运行得非常顺利。
  2. erlang - 这里的关键字是性能稳定性。如果 erlang 不能做到这一点,这可能是一项不可能完成的任务。学习曲线很陡峭,但结果却很棒。
  3. lift - 最后是因为我认为你的项目不需要复杂的域逻辑(在这种情况下我会选择scala)。

from a private email of Gabriele Lana (good friend and exceptional developer).


my order would be:

  1. node.js - keyword is being pragmatic here. I just finished a small project with node.js+redis done in 14 days and it's working like a charm.
  2. erlang - keyword is performance stability here. If erlang cannot do it probably it's an impossible task. Learning curve is steep but results are fantastic.
  3. lift - last because I don't think your project need complex domanin logic (in that case I'd choose scala).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文