I am implementing a website where my users will gain badges upon finishing certain goals or tasks.
Badges will also have levels/colors. So for example, a user will start with a level 0 bronze badge and as they progress they will acquire a level 1 bronze badge, and after a few more levels they will acquire a level 0 silver badge and so on.
I was structuring the Database and i wasn't sure on how to connect the badges to the users.
The idea i came up with was to create 1 table for the users, 1 table for the badges, and a 3rd connecting UserID to BadgeID:
My concern here is optimization.Wouldn't accessing the table and searching the records become slow as more users join the site and gain badges?
And i read here about using a singleton in Java to run a script regularly on the server and check the users' states against the rules to upgrade the badges that meets an upper target. Is this method really scalable? or should i follow this Post instead?
TIA