MT-CTF / capturetheflag

Capture the Flag game using the Minetest Voxel Engine
https://ctf.rubenwardy.com
79 stars 85 forks source link

Restructure the storage of rankings #1261

Open farooqkz opened 5 months ago

farooqkz commented 5 months ago

The current structure storage of rankings using Redis is not efficient at all. IMO, we must be using either something like SQL or Redis sorted sets. Then we easily can get top N, and ranking of each user. I also suggest storing online/play time in the DB.

I am going to do it on the experimental server and then expose a RESTful rankings API. I've opened this issue to better track of the progress and receive comments and feedbacks.

LoneWolfHT commented 5 months ago

If it doesn't have anything to do with rankings it shouldn't be in the rankings db.

Then we easily can get top N, and ranking of each user.

Are you suggesting sorted sets because they're easier, more efficient, or both? I've never heard of them until now, so I'll need to go and figure out what they are before I can approve switching to them.

farooqkz commented 3 days ago

For other's information, approval of switching to them has been given in Discord.