Tournament Deletion from Leaderboard

Hi everyone,

I have a question regarding the deletion of tournaments from the leaderboard in Nakama. Specifically, I’d like to know the following:

  1. Automatic Deletion: Does Nakama automatically delete tournament data from the leaderboard after a certain period or event? If so, what are the conditions that trigger this automatic deletion and how long is it?
  2. Manual Deletion: Is it possible to manually delete a tournament and its associated data from the leaderboard? If yes, could you please provide the steps or API calls necessary to achieve this?
  3. User Data Impact: When a tournament is deleted, either automatically or manually, what happens to the user records associated with that tournament? Are they also removed from the leaderboard, or do they remain accessible in some form?
  4. Best Practices: Are there any best practices or recommendations for managing the lifecycle of tournaments within the leaderboard, especially concerning the cleanup of old or inactive tournaments?

I appreciate any insights or detailed information you can provide on this topic. Thank you!


:tv: Media:

Hello @ghuioio,

  1. Nakama never deletes any leaderboards/tournaments or respective records automatically.

  2. This can be done via a runtime function.

  3. If the leaderboard/tournament is deleted, all the records are too.

  4. All the records are kept until explicitly deleted. A way of deleting inactive tournaments would be to write a server runtime module that on startup lists all inactive leaderboards (see the leaderboardList runtime function in the reference) and selects any that are older than (create_time before) X, then proceed to delete them.

Hope this helps.

thank you very much, I used to think that the leaderboard would automatically be deleted from the database after a certain period of time, such as one month, after it triggered its endTime.

@ghuioio if a leaderboard/tournament ends then it won’t accept any new submissions. To list records that have expired you’ll need to provide the expiry time as a param to the respective listing API/runtime function.

Best.