Can someone explain the difference between GCM and Google Pub/Sub

♀尐吖头ヾ 提交于 2019-12-01 03:31:20

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!