I am using Java in Google App Engine.
The scenario is that users can upvote and downvote an Article object. Users can upvote only once per article. What is the best implementation on this?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create a Vote entity that its key is the user id and the article id. This way you can get the user vote without a query and you don’t need a transaction to create a user vote.