I'm building a bookmarking feature, allowing users to place a marker inside a blog post. The data will then be saved in the database, and retrieved upon opening that blog post.
The same concept can be applied for a lot of things in WordPress, like post ratings, post favoriting, etc. So far I've been creating new MySQL tables (approach 2) for these features, but now I'm second guessing myself.
The two options of approach:
1. Using the native
This would require serializing a list of post ID's and marker positions, and then storing them inside the
wp_usermeta table as a string. Using this method seems the easiest, but I'm not sure how this would affect the performance of the
wp_usermeta table. Especially considering the serialized data could be potentially large.
2. Creating a new table
With this option I would not have to serialize the data, but every new marker would get it's own row, which would have to have the user_id, post_id, and maybe a timestamp inside.
What is the most efficient method of approach?
I would like to know which of these method is preferred, considering things like performance, scalability, compatibility, and ease of use. Or perhaps there is a better method than these two?