Hi @gyutaelee ,
Thanks for the detailed questions.
1. Friend Relationship Direction - Yes, bidirectional
AddFriends: When user A callsAddFriends([B]), both A and B see each other inListFriends("brainCloud")- Both A and B will appear in each other's
GetSocialLeaderboardresults (if they have scores) RemoveFriends: Removes the relationship from both users atomically
2. Idempotency - Yes, both are idempotent
- Calling
AddFriends([B])when already friends: No-op, no error thrown (skips DB write) - Calling
RemoveFriends([B])when not friends: No-op, no error thrown
3. Consistency and Caching - Immediate
- Friend changes are persisted immediately to the database (no write-behind caching)
ListFriends("brainCloud")andGetSocialLeaderboardreflect changes immediately afterAddFriends/RemoveFriends- No eventual consistency or caching delay
4. Friend Count Limits - No hard cap
- No code-enforced limit on brainCloud friends per user
- Practical consideration: Friend IDs stored as array on UserProfile; very large arrays (>10K) may impact read/write performance
5. GetSocialLeaderboard Behavior - Returns all friends + self + pacers, no limit
- Returns all recognized friends + self + pacers
- No hidden maximum result count
- Pacers are included (if leaderboard has pacers configured)
- Warning: Response payload grows linearly with friend count
6. Recommended API for Top-N - Yes, use GetMultiSocialLeaderboard
GetMultiSocialLeaderboardwith a single leaderboard ID is a correct approach for top-N resultsleaderboardResultCountis applied after social filtering and score sortingleaderboardResultCountis capped bymaxMultipleLeaderboardScoreLimitapp property (default 10, can be raised in app-basis)- Preferred over
GetSocialLeaderboardfor top-N because it has built-in truncation
7. Social Leaderboard Pagination - Not supported
- No
GetSocialLeaderboardPageAPI exists (onlyGetGlobalLeaderboardPagefor global leaderboards) - Social leaderboards always return the full friend set (potentially truncated by
leaderboardResultCountonly in the multi variant) - I will forward your pagination request for team review
8. Billing and API Counts - 1 API call per request
GetSocialLeaderboard= 1 API call regardless of friends/entries returnedGetMultiSocialLeaderboard= 1 API call even with multiple leaderboardsAddFriends/RemoveFriends= 1 API call even though they modify both users' profiles
