I am working on a community portal that may in future cater to extremely large user base. All users have about 50 settings that needs to be stored to the user meta. These settings would be frequently accessed and overwritten with new values when the user saves changes to their profile.
This would lead to extremely large number of calls to update_user_meta courtesy: large user base and large number of settings per user.
Would these high number of calls to update_user_meta cause any performance degradation?
An alternative that I see, would be to write the user settings to an array and subsequently store the array to user meta using a single call to update_user_meta.
Which of the two appears to be a better solution?
Regards
John
To answer your questions:
The Higher the number of calls to the database the slower its going to work since every query takes some (not much but still) time.
Recently I finished a project with similar amount of user settings and the solution i ended up with was to store as an array all of the data that i didn’t need to query or search based on, (since when using array to store data in the data base it is stored serialized ) and the rest (data that needs to by queried based on) as single rows of data, which cut down the queries on one page from 68 to just 7.