When we send a notification to all users and persist it, we currently store one record per user in the database. Is this the correct approach? I don’t think it is.
For global notifications such as gift drops, patch updates, tournament rewards, or similar announcements, we may need to send the same notification to the entire user base.
Now imagine we have 200,000 users and just 3 types of global notifications (for example, patch updates). That would create 600,000 records immediately — and this will continue growing over time. This approach can quickly overload and bloat the database.
We should consider a more scalable design for global notifications instead of creating one record per user.
am i using nakama notification in correct way ? or should use custom table or storage colleciton for my need.
The NotificationsSendAll should only be used when an alternative isn’t available - any information relating to patches/announcements - or any “static” data - should just have a public Storage Object that the client can use to list this information, and then cache locally whether it’s already been displayed or not, or something along those lines. Otherwise, as you correctly state, we’ll be polluting the db with records that may never be read unnecessarily, and which will only be deleted if the client “consumes” them (fetch, display & delete).
For reward drops, if these are rewards granted to say, some amount of players that have reached the top X positions in a Leaderboard, then it’s fine to use NotificationsSend to a subset of players, which is ok.