Looking to Build Module Limiting Votes in 24 hrs?
-
Senior Member
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.
-
Pligg Founder
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.
-
Senior Member

Originally Posted by
Yankidank
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
-
By prestidigitator in forum Questions & Comments
Replies: 5
Last Post: 06-16-2011, 06:19 AM
-
By PurpleCow in forum Questions & Comments
Replies: 0
Last Post: 01-28-2011, 10:48 PM
-
By Thana in forum Questions & Comments
Replies: 1
Last Post: 08-18-2009, 09:24 AM
-
By Darksat in forum Questions & Comments
Replies: 2
Last Post: 01-30-2008, 05:37 PM
-
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
-
Forum Rules