Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2009
    Posts
    23

    design a table for recording people's activities

    hi guys,
    does anybody know the structure of the table that records people's activities on those SNS websites? e.g. facebook, when people perform some operations, there will be a message like "Person A uploads a photo", and their friends will know what they've done. I think there must be a table recording this. thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, there is a table recording it

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2009
    Posts
    23
    thanks for the response. but do you know what its structure is? I guess it may be Activity(activityId, operatorId, operatedObject, objectId,...). if any wrong, please correct me.

  4. #4
    Join Date
    Jan 2009
    Posts
    23
    "Buy my book Simply SQL from Amazon "
    congratulations on your new book! I wish it could be bought in China.
    Last edited by chiefman; 02-16-09 at 21:37.

  5. #5
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Wasn't the structure of facebook given in this thread?

  6. #6
    Join Date
    Jan 2009
    Posts
    23
    no. the thread you referred to is about how to store the relationship. my present question is about how to store the user's activity. they're different

  7. #7
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    there will be a message like "Person A uploads a photo", and their friends will know what they've done. I think there must be a table recording this.
    If it's not in the original facebook database then can't you just get a bit creative and create a table called UserActivity and simply store what the user does. You might want a flag to indicate whether to notify friends or not so important things can get notified out while lesser things might just be logged. You might want to include some form of optional id field etc to indicate what photo has been uploaded. Now when the user does anything interesting you can tell his friends about that activity ie
    Code:
    create table UserActivity (
      user_id
      activity_description
      notify_flag
      time_completed
    )
    
    insert UserActivity values ( 1234, 'added new photo',1,now() )

  8. #8
    Join Date
    Jan 2009
    Posts
    23
    thank mike_bike_kite. I think I got a little process on it.
    Activity(activityId, operatorId, activity_description, operatedObject, objectId, happenTime). but it is not perfect.

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •