Results 1 to 3 of 3
  1. #1
    Senior Member Ascendancy's Avatar
    Joined
    Jan 2008
    Location
    Massachusetts
    Posts
    133
    Version
    1.2.0
    Site
    http://sourcecanvas.com/

    Looking to Build Module Limiting Votes in 24 hrs?

    I'm looking to create a small module which restricts the amount of votes a user can cast in 24 hours. Instead of pulling a new MySQL query every time the user votes I'd like to have some local caching system where it checks and stores each vote the user gives, and can then limit them if they pass before 24 hours is up. What would be the best way to cache this data?

    Should I just pull from the database with every vote? This was my original idea, check the function each time a user casts a vote to see if they've exhausted their limit. But then I don't know if it's better to build a whole new d/b table for this info.

  2. #2
    Pligg Founder Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,065
    Site
    http://pligg.com/demo/
    I'm not so great with MySQL optimizations, so I wouldn't be the best person to answer this. I think that the number of users you are dealing with and the amount of traffic would need to be considered. If your site doesn't have a ton of traffic then the advantages of doing some more advanced data caching are pretty negligible. In most website's cases I imagine that pulling the data from a database with every vote would be acceptable without having much of a performance hindrance.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  3. #3
    Senior Member Ascendancy's Avatar
    Joined
    Jan 2008
    Location
    Massachusetts
    Posts
    133
    Version
    1.2.0
    Site
    http://sourcecanvas.com/
    Quote Originally Posted by Yankidank View Post
    I'm not so great with MySQL optimizations, so I wouldn't be the best person to answer this. I think that the number of users you are dealing with and the amount of traffic would need to be considered. If your site doesn't have a ton of traffic then the advantages of doing some more advanced data caching are pretty negligible. In most website's cases I imagine that pulling the data from a database with every vote would be acceptable without having much of a performance hindrance.
    Thanks man I appreciate the input. The site only runs a total of ~850 members and I'm thinking maybe 1/3 are truly active... so it'll probably be fine.

Similar Threads

  1. Limiting a single IP's voting ability
    By prestidigitator in forum Questions & Comments
    Replies: 5
    Last Post: 06-16-2011, 06:19 AM
  2. displaying votes for 'sidebar stories' module
    By PurpleCow in forum Questions & Comments
    Replies: 0
    Last Post: 01-28-2011, 10:48 PM
  3. Limiting the number of emails in send announcement module
    By Thana in forum Questions & Comments
    Replies: 1
    Last Post: 08-18-2009, 09:24 AM
  4. Limiting comments on the story page.
    By Darksat in forum Questions & Comments
    Replies: 2
    Last Post: 01-30-2008, 05:37 PM
  5. Page Statistics Module error (build 758)
    By haxhax in forum Questions & Comments
    Replies: 6
    Last Post: 02-27-2007, 06:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting