有人可以解释GCM和Google Pub / Sub之间的区别吗? [英] Can someone explain the difference between GCM and Google Pub/Sub

查看:137
本文介绍了有人可以解释GCM和Google Pub / Sub之间的区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google在这里回答了这个问题。



https ://cloud.google.com/pubsub/faq



但是我仍然不清楚每种情况下会使用哪种情况?



有没有什么pub sub可以做哪个GCM无法做到的?

解决方案

Google Cloud Pub / Sub和GCM之间的主要区别在于缩放点。 GCM旨在按照终端用户设备(如电话)的顺序扩展到许多独立的发布者和订阅者。另一方面,Cloud Pub / Sub的设计可以扩展到较小的发布者和订阅者的吞吐量。

这两者实际上可以一起使用。想象一下,例如,您正在构建股票市场通知应用程序,用户在某些股票达到特定价格时收到通知。您建立了一项服务,可以从各种来源抽取股票价格,对其进行处理,然后通过Cloud Pub / Sub发布股票价格。您有一个单独的服务,订阅Cloud Pub / Sub并获取这些股票价格。然后确定应用的哪些用户感兴趣,并使用GCM向有兴趣的用户发送通知。

Cloud Pub / Sub允许您将摄取与不同的来源和将更新发送给用户的服务。您的服务将是Cloud Pub / Sub的发布者和订阅者,并在它们之间移动大量数据。向个人用户发送通知的吞吐量将会小得多,并且你有更多的用户,所以GCM将成为用于该部分的合适系统。


Google did answer the question here

https://cloud.google.com/pubsub/faq

But I'm still unclear on which scenarios would each be used for?

Is there something that pub sub can do which GCM can't?

解决方案

The primary difference between Google Cloud Pub/Sub and GCM is the points for scaling. GCM is designed to scale to many individual publishers and subscribers, on the order of end user devices such as phones. Cloud Pub/Sub, on the other hand, is designed to scale to very large throughput from/to fewer publishers and subscribers.

The two could actually be used together. Imagine, for example, you were building a stock market notification app where users get notifications when certain stocks reach certain prices. You set up a service that pulls stock prices from a variety of sources, processes them, and then publishes stock prices via Cloud Pub/Sub. You have a separate service that subscribes to Cloud Pub/Sub and gets these stock prices. It then determines which ones are of interest to which users of the app and uses GCM to send notifications to those interested.

Cloud Pub/Sub allows you to decouple your ingestion from different sources and your service that sends updates to users. Your services would be the publishers and subscribers to Cloud Pub/Sub with a large feed of data moving between them. The throughput on notification to individual users will be much smaller and you have a lot more subscribers, so GCM would be the proper system to use for that part.

这篇关于有人可以解释GCM和Google Pub / Sub之间的区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆