Does the system have to do a COUNT(*) query on the user's votes for the day, then determine if the daily limit is reached? Or is there another method to doing this?
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
We do exactly what you describe.. we
If you're asking if there's another way to do so, then obviously yes.
In the user table, add a column for each vote limit. Reset the columns every night to the appropriate vote allowance. Decrement the value every time you use a vote. Check the value to know how many votes are left.
Similarly, for rate limited actions, add a column with the timestamp of the last time you changed something. Do a date diff to know how much time has passed and deny or allow accordingly.
Is this what SE does? I don't know. It might be. It might not. I have never really done databases, so I don't know how horrible this idea is.