I looked at this site for an answer, but I'm still a little unsure how to plan a similar system in the structure and implementation of the database.
In PHP and MySQL, it would be clear that some achievements are earned immediately (when in the case of SO with special actions a specialized action was taken: all profile fields are filled), although I know SO updates and assign icons after a certain amount of time, With so many users and icons this will not create performance problems (in terms of scale: a large number of users and icons).
So, the database structure that I assume will be as simple as:
Badges | Badges_User | User ---------------------------------------------- bd_id | bd_id | user_id bd_name | user_id | etc bd_desc | assigned(bool) | | assigned_at |
But, as some people claim, it would be better to have an incremental style, so a user who has 1,000,000 posts in the forum will not slow down the execution of any functions.
Will this be another table for icons, which can be incremental or just a progress field in the badges_user table above?
Thank you for reading and we will focus on the scalability of the desired system (for example, thousands of users and 20-40 icons).
EDIT: for some, you can confuse some of the confusion that I assigned as a date / time, the criteria for awarding the badge is best placed inside the prepared queries / functions for each badge, right? (better flexibility)
php mysql architecture scalability
bluedaniel Nov 16 '09 at 20:45 2009-11-16 20:45
source share