Snooping-safe Vote tables

database-designpermissionsSecuritytable

I have a table with both user_id and vote. They are stored together so each user can only give one vote. However it's also problematic because admins can simply read who voted what. Is there a way to make it so that only the system(minus all humans) and the user knows what was voted by h(im|er)self?

Best Answer

I'm not sure how much scope you have to make changes but why not separate the 2 concepts.?

Have a field or flag on the user table has_voted. And put the vote in a separate table.

App logic checks to see if they have voted, and only allows them to vote if the field is blank. Vote gets inserted in separate table so you can't tell who has voted for what.