有人能解释一下GCM和谷歌Pub/Sub的区别吗?

时间:2021-01-09 15:26:23

Google did answer the question here

谷歌确实回答了这个问题

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

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?

有什么是酒馆订阅可以做的而GCM不能做的吗?

3 个解决方案

#1


9  

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.

谷歌云Pub/Sub和GCM之间的主要区别是扩展点。GCM的设计是针对许多独立的发布者和订阅者,以终端用户设备(如电话)的顺序。另一方面,云发布/订阅被设计成从/到更少的发布者和订阅者的非常大的吞吐量。

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发布股票价格。您有一个单独的服务订阅Cloud Pub/Sub,并获得这些股票价格。然后,它确定哪些用户对应用程序感兴趣,并使用GCM向感兴趣的用户发送通知。

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将是用于该部分的合适系统。

#2


1  

Google Pub/Sub is a Enterprise services bus, you could use it when your business has many systems, but these systems are separated, with their our databases, with a enterprise service bus you could communicate these systems by messages. And GCM( now Firebase Cloud Messaging(FCM)) is a notification server, when you can communicate or send a information from a device to other devices, you could use FCM.

谷歌Pub/Sub是一种企业服务总线,当您的企业有许多系统时,您可以使用它,但是这些系统是分开的,与它们的数据库,与企业服务总线,您可以通过消息通信这些系统。GCM(现在的Firebase云消息传递(FCM))是一个通知服务器,当您可以从设备向其他设备通信或发送信息时,您可以使用FCM。

#3


1  

Google Pub/Sub is the equivalent of the traditional SOA Enterprise Service Bus for message management whereas GCM/Firebase is more for notification services (for eg notifications to mobile). The primary intent of Google Pub/Sub is for server to server messages but can also be used for notifications services that GCM was intended for, sort of like a super set of GCM.

谷歌Pub/Sub在消息管理上相当于传统的SOA企业服务总线,而GCM/Firebase更适合通知服务(如移动通知)。谷歌Pub/Sub的主要目的是用于服务器到服务器的消息,但也可以用于GCM打算用于的通知服务,类似于GCM的超集。

#1


9  

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.

谷歌云Pub/Sub和GCM之间的主要区别是扩展点。GCM的设计是针对许多独立的发布者和订阅者,以终端用户设备(如电话)的顺序。另一方面,云发布/订阅被设计成从/到更少的发布者和订阅者的非常大的吞吐量。

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发布股票价格。您有一个单独的服务订阅Cloud Pub/Sub,并获得这些股票价格。然后,它确定哪些用户对应用程序感兴趣,并使用GCM向感兴趣的用户发送通知。

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将是用于该部分的合适系统。

#2


1  

Google Pub/Sub is a Enterprise services bus, you could use it when your business has many systems, but these systems are separated, with their our databases, with a enterprise service bus you could communicate these systems by messages. And GCM( now Firebase Cloud Messaging(FCM)) is a notification server, when you can communicate or send a information from a device to other devices, you could use FCM.

谷歌Pub/Sub是一种企业服务总线,当您的企业有许多系统时,您可以使用它,但是这些系统是分开的,与它们的数据库,与企业服务总线,您可以通过消息通信这些系统。GCM(现在的Firebase云消息传递(FCM))是一个通知服务器,当您可以从设备向其他设备通信或发送信息时,您可以使用FCM。

#3


1  

Google Pub/Sub is the equivalent of the traditional SOA Enterprise Service Bus for message management whereas GCM/Firebase is more for notification services (for eg notifications to mobile). The primary intent of Google Pub/Sub is for server to server messages but can also be used for notifications services that GCM was intended for, sort of like a super set of GCM.

谷歌Pub/Sub在消息管理上相当于传统的SOA企业服务总线,而GCM/Firebase更适合通知服务(如移动通知)。谷歌Pub/Sub的主要目的是用于服务器到服务器的消息,但也可以用于GCM打算用于的通知服务,类似于GCM的超集。