MySQL Forums
Forum List  »  Newbie

Re: How best to storing User Profile data
Posted by: Rick James
Date: July 18, 2009 11:43PM

Assumptions:
* You have quite a few fields.
* There are likely to be more fields in the future.
* You don't need to index most of the fields.

Given those, I vote for the serialization approach.

Plan A: One table with id, indexed columns, serialized blob.

Plan B: One table has the meta info (id and indexed columns). One table has the same id and the blob. If you are expecting to be tight on disk space, compress the blob.

Advantage of A: Simpler.

Advantage of B: Performs better when you need to search the meta info without also needing the fields in the blob.

(The 'blob' could be either a BLOB data type, or TEXT. TEXT would require a consistent charset for all the fields. I like JSON for serialization; it is utf8. If you compress, it would have to be BLOB, not TEXT.)

Options: ReplyQuote


Subject
Written By
Posted
Re: How best to storing User Profile data
July 18, 2009 11:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.