Hi
Scenario I want:
I have 18 segments.
Based on "rank" statistic, bronze 123, silver 123 etc.. Total of 18 segments.
(eg, bronze 1000~1100 statistic filter)
Every Sunday night, I run the cloud code for each segment. (scheduled task recurring)
Each segment performs a different function.
(Bronze segment of 1100 subtract 100 points, and bronze reward is paid.
And silver is subtract by 200pts and silver reward is paid)
In order to implement the above function, I thought of two ways.
1. After creating "18 scheduled tasks", execute the cloud function for each segment.
2. After creating "only one Scheduled task", call serverAPI.GetPlayersInSegment 18 times in one function.
Then, for each segment, "for" statement executes to get all players in each segment.
(If there are more than 10,000 players, it will be complicated to consider paging as well.)
above
#1 is (i think) good idea but there is a high probability that system will be limited to 25 task limits.
#2 is (i think) to be expensive if the server API is executed with each "for statement" for more than 10,000 players in one cloud function.
In other words, after getting 10,000 players(assumption) for each segment, "updateStatistic" and "grantToItem" functions are called per player.
Since two apis are called per player, a total of tens of thousands of calls will be made.
Is this a better way than using the 18 tasks above? What is the way I should do it?