Jump to content

Best Approach for creating a user driven ratings system


dfunk006
 Share

Recommended Posts

Hi,

I'm working on creating a user driven ratings system where:

  1. A user can rate an item only once
  2. There is only one item on one page
  3. The user needs to login before rating
  4. The user can update /change his rating

For doing this, I am planning to create a new page for every rating which will save the item, user and rating.

However, if I have 10,000 items and 10,000 users and assuming everyone rates, there will be 100 Million pages created.

Is this the best way to approach this, or is there a better way?

Note: I am not using repeaters since they are not infinitely scalable. 

Link to comment
Share on other sites

Thanks for your reply kongondo!

I took a look at this one earlier: http://processwire.com/talk/topic/4561-fieldtyperate-star-rating/

I don't think the ratings are stored for each user.

As far as I understand, I can save each rating in a field inside a user's page and item's page (doubt if this is the recommended approach) or in a field within a new page (will result in too many pages).

Is there another way to do this?

EDIT: Just checked this out too: http://processwire.com/talk/topic/2126-rudimentary-5-star-rating-system/

It uses cookies, no user login required and doesn't store the ratings.

Link to comment
Share on other sites

Advantage with pages is that you can easily use PW API to select, manipulate, etc..the records.But there's nothing stopping you from creating custom tables to store the ratings and associate those with your users. [e.g. storing user ID together with their ratings]. Btw, there is nothing wrong with 1 million pages :-), per see...viewing them in the tree might be an issue though..in terms of scrolling through (but theres' search). If you have lots of pages, you can hide them under some parent page, e.g. in admin, and create a module to list them in a table with links to edit them. I am just thinking out loud here....Undoubtedly you'll get better ideas soon ... O0

  • Like 1
Link to comment
Share on other sites

Yes, that advantage is definitely there which is why I'm drawn to that approach, although I am concerned about scalability. Also, its 10 Million, not 1 Million! ;)  

If I go the custom tables route, I'll have 10 Million rows. Is that better than having 10 Million pages, or not really?

Thanks a lot for your help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...