Spray 框架生产准备好了吗?
Spray 框架 (spray.cc) 似乎是使用 Scala 和 REST 构建 REST 服务的一种有趣且高效的方式。阿卡。我来自 Java + Spring 学校,那里的一切都有很好的文档记录、成熟并且有良好的社区支持。
虽然 Spray 玩起来很有趣,但它也有其粗糙的一面。我对在实际应用中使用它持怀疑态度。
有人在生产环境用过Spray吗? Spray 周围的开源社区怎么样?是否可以轻松获得帮助?
更新: Spray 与 BlueEyes (https://github.com/jdegoes/blueeyes) 相比如何?
Spray framework (spray.cc) seems to be a fun and productive way to build REST services using Scala & Akka. I come from Java + Spring school, where everything is well documented, mature and has good community support.
While Spray is fun to play with but it has its rough edges. I am skeptical about using it in a real application.
Has anyone used Spray in production environment? What about the open source community around Spray? Is it possible to get help easily?
UPDATE: How does Spray compare against BlueEyes (https://github.com/jdegoes/blueeyes)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们在电信中间件应用程序中使用 Spray,我想说 Spray 已做好生产准备,
我认为 BlueEyes 没有与 Akka 无缝集成,也没有良好的文档。不确定它是否可以部署在 Web 容器或 akka 内核中。 Spray 的一些功能也复制自 BlueEyes。
-杰斯坦
We are using Spray in a telco middleware application and I would say Spray is production ready and,
I think BlueEyes does not have seamless integration with Akka or good documentation. Not sure it can be deployed inside a web container or akka kernel. Spray's some features are copied from BlueEyes too.
-Jestan
尽管我们还没有投入生产,但我们正在为新成立的 Shopolate 使用喷雾。到目前为止,我们的测试显示出出色的吞吐量,并且使用它进行开发非常高效。
到目前为止我们没有发现任何错误。
Spray 论坛上的问题很快就会得到解答,但它仍然是一个起步社区。我发现文档非常完整且清晰。一大优点是底层设计的轻量级/优雅性,这使得喷雾源代码非常容易掌握和扩展。
到目前为止,影响我们的唯一缺点是功能集相对较小,但它正在稳步增加。
我不了解BlueEyes,所以我无法回答问题的第二部分。
Althouh we are not yet in production, we are using spray for Shopolate, a new startup. So far our tests are showing an excellent throughput, and developing with it is very efficient.
We found no bugs so far.
Answers to questions on the Spray forum are coming quite quickly, but it still remains a starting community. I found the documentation to be quite complete and clear. One big plus is the lightweight / eleganc of the underlying design, which makes the spray source code very easy to grasp and extend.
The only downside that impacted us so far is the relative small sets of features, but it is increasing steadily.
I don't know BlueEyes, so I can't answer to the second part of the question.
Spray 是一个非常好的框架,背后有一些非常聪明的人。它为您提供了简单的代码,可以在功能和并发用户方面很好地扩展。如果您希望最终得到一个易读的应用程序(良好的结构,易于找到哪个 url 映射到哪个功能等),Spray 非常棒。
但并非一切都很好。
与 Akka 的紧密耦合是一把双面剑。对于简单的应用程序,它增加了不必要的复杂性。如果你想在使用 Spray 之前拥抱 Akka,请仔细考虑。
目前,Spray (1.1M4) 的指令文档非常有限,因此您大部分时间只能靠自己阅读高级 Scala 代码,摸不着头脑。
到目前为止,向后兼容性还没有得到认真对待。升级时预计会触及您的所有代码。这不仅要归咎于 Spray,还要归咎于 Akka 和 Scala 本身。如果您不喜欢这个,请使用像 Spring MVC 这样无聊而可靠的东西。
使用的 Scala 语言结构很难正确解析,以至于大多数 IDE 都会丢失,您必须等待实际的编译器完成其工作,然后才能知道您面临的是什么。我之前说过代码很容易阅读,但这只是高层的。您很容易有点了解正在发生的事情,但要实际上了解正在发生的事情,您的头脑中需要大量的堆栈空间。
我在生产中使用 Spray 并坚持使用它(可能),但这并不是一件容易的事。预期会因同等措施而感到沮丧和高兴。
Spray is a really nice framework with some exceptionally smart guys behind it. It gives you simple code that scales well in terms of both features and concurrent users. If you want to end up with an application that reads well (good structure, easy to find which url maps to which feature etc), Spray is awesome.
Not all is great though.
The tight coupling with Akka is a two sided sword. For simple applications it adds unnecessary complexity. Think carefully if you want to embrace Akka before going for Spray.
At this moment Spray (1.1M4) has very limited documentation for the directives, so you're on your own mostly, reading advanced Scala code, scratching your head.
Backwards compatibility is not taken seriously so far. Expect to touch all your code when upgrading. This is as much to blame on Akka and Scala itself as on Spray. If you don't like this go with something boring and reliable like Spring MVC.
The Scala language constructs used are so hard to parse correctly that most IDE's get lost and you'll have to wait for the actual compiler to do its job before you know what you're up against. I said before that the code was easy to read, but that is only at a high level. You very easily sort of get what is going on, but to actually get what's going on you'll need a lot of stack space in your head.
I'm using Spray in production and sticking with it (probably), but it's not an easy ride. Expect to be frustrated and delighted in equal measures.