[英]Apollo GraphQL server in AWS cloud with subscriptions
I would like to set up an apollo graphql server using AWS. 我想使用AWS设置apollo graphql服务器。 I tried setting up apollo-server-lambda with AWS Lambda and it works perfectly fine, however it lacks pretty important feature: subscriptions, and for those you would need a websocket server.
我尝试使用AWS Lambda设置apollo-server-lambda,并且效果很好,但是它缺少非常重要的功能:订阅,对于那些您需要Websocket服务器。
I saw this solution for this problem https://github.com/ioxe/graphql-aws-iot-server which uses AWS IoT to handle subscriptions but it seems to be rather complex and non-maintained. 我通过https://github.com/ioxe/graphql-aws-iot-server看到了用于解决此问题的解决方案,该服务器使用AWS IoT来处理订阅,但它似乎相当复杂且无法维护。
My question is it a right solution to get subscription or should I just set up an EC2 instance and run apollo sever there? 我的问题是获取订阅的正确解决方案,还是应该只设置一个EC2实例并在其中运行apollo服务器?
Also, If I do set up an EC2 instance for that, will it be easier to set up and how should it be scaled? 此外,如果我确实为此设置了EC2实例,那么设置起来会更容易吗,以及如何扩展它?
PS Before you ask, I am aware about AWS AppSync and this service is not suitable as it has a big problem with N+1 issues, long query execution times and broken android client. PS在您问之前,我知道AWS AppSync,并且此服务不适合使用,因为它存在N + 1问题,查询执行时间长以及android客户端损坏的大问题。
我当前正在使用AWS Lambda,但是当我需要添加订阅时,我计划迁移到Elastic Beanstalk,而不是简单的EC2实例,因为它为您做了很多扩展,而且自阿波罗服务器2以来,它大约只有一行从Lambda切换到Beanstalk的代码集
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.