06-17-2020 03:39
06-17-2020 03:39
Context
- I am planning to release my backend application for which I am using subscription api. All my application users are active fitbit users and they wear the fitbit device and have auto sync enabled (In the companion app).
- I have implemented the subscription callbacks in my backend so that I get notified everytime the data changes. https://dev.fitbit.com/build/reference/web-api/subscriptions/
- I have a limitation on the no of concurrent api calls I can support in my backend (can provide more details on this if needed)
Question
What I am trying to understand is how the subscription notifications will be send out to my backend server.
So for example, if I have 3000 active users all who have enabled auto sync (In the fitbit companion app),
- will all the subcription notification calls come at the same time ? As in 3000 notifications in the same second / minute etc?
- Will it be spread out ? How will the spread be ? As in what is the expected no of notifications per second.
- What is it dependent on ?
PS: I am not trying to ask if I should reply back on the subscription notification immediately before calling the web api (which could be time consuming), that I have already implemented. What I am trying to understand is the pattern on how the subscription end point is called.
06-18-2020 14:59 - edited 06-18-2020 15:02
06-18-2020 14:59 - edited 06-18-2020 15:02
Sounds like you have everything ready to deploy. Awesome!
On average, the notifications will be sent within a minute after Fitbit receives the data from the devices. We do try to group notifications together that get generated near the same time. For large deployments, I've seen a subscriber receive a single response containing 20-30 messages.
Unfortunately, we don't have metrics or guidelines to inform you with how many messages you would receive or how many would be grouped together.
One thing we do recommend is, if possible, queue up the notifications your subscriber receives and process them when your application is ready.