Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

To answer your questions:

Would these high number of calls to update_user_meta cause any performance degradation?

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.

Which of the two appears to be a better solution?

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.

share|improve this answer
    
Thx a lot for the reply! You cleared the dilemma I had. –  John Oct 4 '11 at 18:35
    
Glad i could help. –  Bainternet Oct 4 '11 at 18:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.