Skip to content

Performance issue with sending notifications to multiple devices - Suggestion for improvement #139

Description

@GabrielAziz

Hi,

I'm experiencing a performance bottleneck when sending notifications to a large number of devices (more than 20 at a time). Our platform allows users to select specific recipients, making device groups and topics unsuitable for this use case.

To address this, I'm considering using Sidekiq to handle the notification sending. However, the current implementation requires instantiating a new FCM client for each job, which leads to unnecessary re-authentication and performance overhead.

I propose the following improvement:

  1. Generate the authentication token in the main application service.
  2. Pass the token and firebase_project_id to the Sidekiq worker.
  3. Instantiate the FCM client within the Sidekiq worker using the provided token and firebase_project_id, instead of passing the full google_credentials again.

This approach would avoid redundant authentication and significantly improve the performance of sending notifications to multiple devices.

Thank you for considering this suggestion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions