问题描述
我想开发一个GAE应用程序.但是,我之前使用过play框架,非常喜欢它的布局.我想知道最新版本(我认为是2.3)是否可以与Google App Engine一起使用?我以前看过有关此的帖子.有人说这是不可能的.我见过一个关于将代码移植过来的github项目,但是没有人对项目的成功发表过评论.我担心效率降低/功能过多.
I am wanting to develop a GAE application. However, I have used the play framework before and very much liked its layout. I was wondering whether the latest version (2.3 I think) works with Google App Engine? I have seen posts about this before. Some say it is not possible; I've seen a github project on porting the code over but no one has ever commented on the success of the project. I am concerned about losing efficiency/too much functionality.
能做到吗?
如果没有,关于框架的任何建议(我真的不应该问这个关于stackoverflow的第二个问题).
If not, any suggestions on frameworks (I know I am not really supposed to ask this second question on stackoverflow).
推荐答案
看看此存储库,这样您就可以将Play应用打包到可以部署到GAE的战争中.
Have a look at this repo which enables you to package your Play app in a war that you can deploy onto GAE.
但是在执行此操作之前,您应该考虑取舍. Play设计为无状态/异步,并且GAE在Java Servlet Spec上运行.这意味着(通常):-
But you should consider the trade-offs before doing this. Play was designed to be stateless/Asynchronous and GAE runs on Java Servlet Spec. This means (generally):-
- 您的Play应用不会在GAE上真正异步
- 您可能会因为在GAE上的servlet容器中运行而降低性能(取决于您的应用程序,尽管您甚至无法测量它,所以我不必为此担心太多)
我个人发现,将Play应用程序部署到Digital Ocean(我使用Docker,但您不必这样做)对我来说确实很好.我过去曾使用GAE,但由于上述原因,我不会在那里部署Play应用. Heroku是一个不错的选择,但是如果您需要横向扩展,则成本会更高.
I have personally found that deploying my Play apps into Digital Ocean (I use Docker but you don;t have to) work really well for me. I have used GAE in the past but I wouldn't deploy a Play app there for the reasons stated above. Heroku is a nice alternative but gets a bit costly if you need to scale out.
这篇关于带有Google App Engine的Activator Play Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!