title: Database structure for user activity done right way?
body: <p>what is the right way to do user activity logs like how facebook does it and really fast at it too. i have a website for a client, which has activity logs the activity of user and show to his/her friends/family/followers but its very slow, we are willing to make changes in database, if it will help improve user interactivity and do the logs right way. im sure lots of people already research on it, but i cant find any links for it, that shows how its done proper way, so i can implement that too. any help?</p>
  
  <p><strong>Desired Output of activities</strong></p>
  
  <p><img src="https://i.stack.imgur.com/25xG0.png" alt="enter image description here"></p>