Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Rate anything: new plugin in development, soliciting architecture advice

@boonebgorges

Keymaster

`this will not scale well because some objects have no meta table (such as images)`

How are the images being stored? If they are uploaded through the Media uploader, then they are just a post type of their own, right?

I guess that, if I knew that each rate-able content type would have a meta table, that I would store individual ratings in a post type, and store aggregate/average ratings in meta (updated each time a new rating is posted). That’s how I do it on the (admittedly imperfect) BP Group Reviews plugin. But if that won’t work, it wouldn’t be too complicated to have a second post type for average ratings. I don’t think this would introduce too much inefficiency, since there would be far fewer posts of this type (a max of one for each item) than individual ratings.

No matter where you store it, I would recommend storing the aggregate/average scores separately instead of calculating them on each page load (whether in PHP or MySQL). (Or maybe you’re not suggesting this? :) )

Skip to toolbar