Search code examples
androidpush-notificationnotificationsurbanairship.comandroid-push-notification

Is CPU and bandwidth intensive sending push notifications directly with Firebase Cloud Messaging?


From what I understand, when sending notifications from the Firebase compose message console from https://console.firebase.google.com/u/0/project/[projectname]:api-project-[senderID]/notification/compose, only CPU and bandwidth from the Google servers is consumed because the notifications are sent directly from the Google servers, not from mine, correct? If I use cURL to trigger push notifications from my servers, it would still use Firebase and Google servers to send and deliver the notifications, and it would not consume CPU and bandwidth from my servers, correct?

I am trying to fully understand whether or not sending push notifications directly with Firebase Cloud Messaging and without third party solutions such as Urban Airship is CPU and bandwidth intensive on my servers. I am not sure if part of the features/benefits that third party push notifications solutions offer is handling CPU/bandwidth intensive tasks, or if that is something that the Google servers handle directly when connecting and sending push notifications directly with Firebase Cloud Messaging.

I know StackOverflow is not for questions that arise debate, especially about architectures and in-house versus third party software solutions, but the main purpose of my question is knowing who handles the CPU and bandwidth intensive work when push notifications are sent to thousands of devices, is it the Google servers (Firebase Cloud Messaging servers), or the servers of the software company that provides the push notifications service such as Urban Airship, or the servers that trigger the push notifications in case the Firebase Cloud Messaging configuration is built in-house without third party solutions? Thank you.

EDIT: The answer at Why and how is push-notification (like GCM) battery efficient? includes this paragraph: "The android device keeps a single connection open to GCM servers to listen for notifications". However, it still does not answer my question because even though I know that the Firebase Cloud Messaging servers are responsible for sending the push notifications, I am still trying to understand if my servers do not have to provide CPU power or bandwidth at all, even if I use cURL to trigger the push notifications from my server using PHP cURL functions and cron jobs, for instance. If I can make an analogy, imagine using jQuery by importing the library directly from https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js versus downloading the jquery.min.js file and then putting it on your server. If you use https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js you would be using resources from Google servers, not from your own servers. If you download the jquery.min.js to your server, then visitors would be using resources from your own servers, not from Google's servers. That is my analogy, so in the case of push notifications using Firebase Cloud Messaging without third party solutions such as Urban Airship, I was wondering who provides the CPU power and bandwidth, your own servers or Google's servers. Thank you.


Solution

  • In that case, it should be fairly simple if you use a mechanic like GCM topic. It should not be CPU intensive since you are not sending to each individual user but just one broadcast to the topic and let Google do the heavy lifting.

    https://developers.google.com/cloud-messaging/topic-messaging https://firebase.google.com/docs/cloud-messaging/android/topic-messaging