简体   繁体   English

我应该在node.js或rails中实现GCM服务器吗?

[英]should I implement a GCM server in node.js or rails?

I'm building an API for a mobile app with Rails and I need to implement a Google Cloud Messaging server. 我正在为使用Rails的移动应用构建API,我需要实施Google Cloud Messaging服务器。

I see that there are ready libraries available both for Rails and node.js, 我看到Rails和node.js都有现成的库,

what would be a better approach for this? 什么是更好的方法呢? implementing the GCM server in Rails (it involves database tables and tasks for background work) or in node.js (seems much simpler, GCM use JSON and also for quickly implementing exponential back-off. the Rails server will have to HTTP POST the messages to the node.js server). 在Rails中实现GCM服务器(它涉及用于后台工作的数据库表和任务)或在node.js中实现(看起来更简单,GCM使用JSON并且还用于快速实现指数退避.Rails服务器将必须HTTP POST消息到node.js服务器)。

You should choose the solution that would be easier for maintenance, in the long run. 从长远来看,您应该选择更易于维护的解决方案。 And of course it depends on other things as well: Are you on a tight schedule - choose the solution that faster to implement. 当然,这也取决于其他事项:您是否处于紧张的时间表 - 选择更快实施的解决方案。 Is one of the solutions in a technology that you're completely unfamiliar with - choose the one that you do know. 是您完全不熟悉的技术解决方案之一 - 选择您所知道的解决方案。 And etc. 等等。

I ended up using node.js and the node-gcm module. 我最终使用node.js和node-gcm模块。

it was very easy to build and test and as I said in the OP, implementing exponential back off and retries is very easy and doesn't require any database or additional web workers. 它很容易构建和测试,正如我在OP中所说,实现指数退避和重试非常简单,不需要任何数据库或其他Web工作人员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM