I am working on a Xamarin.Forms PCL social media app project. People can like posts and comment on them which is saved in MySQL. I would like to add an activity page.

What is the best way to calculate users activity, I don't think UNION will work since the comments table has a different structure than the likes table.

I was considering creating an activity table which would be "userid|message|timestamp" then just grab all those but that doesn't seem very efficient.

Also how do I prevent spam of notifications if a user likes/unlikes a picture multiple times to spam another user?


to prevent spam i would recommend like/dislike functionality must be for signed user and based on that allow just once. And even you can detect and block the user if needed. but be careful that notifying the user every time when there is like and unlike. talking about users activity making activity table is a good option for every activity user makes it will be recorded in activity table and you can view it as a report.

|improve this answer|||||
  • For the activity table wouldn't it overload with all the users liking posts, commenting, and following each other? – Dan Mar 15 '18 at 1:52
  • you can make multiple activity table as you needed and join when you show the report if it is. – Sinte Mar 16 '18 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.