What is the most efficient way of implementing a favorite post system?

Use a custom table. Create it as a network table, and store the site ID, so you can use just one table for the whole network.

row_id | site_id | post_id | user_id

There is no equivalent for such a table in the current core tables. Avoid serialized data, because that format is PHP specific, so you cannot read its data in any other language (including SQL), and sorting by or searching for any value is just awkward.

You have to track sites, users and posts now to delete matching entries whenever one of these objects is deleted.

Leave a Comment