English 中文(简体)
How best structure or query data to display similar to the "feed" in facebook?
原标题:
  • 时间:2009-11-16 01:13:06
  •  标签:
  • facebook

Our app is displaying its information in a way similar to that found on Facebook s "feed" page which shows a timeline of activity by members of the particular profile s network.

I can see that could be very heavy if done with a relational/sql-statement in a traditional sense, but wanted some ideas on how to best do so in a way that wasn t so expensive -- ideally, I could keep things in a relational table and there were some clever approached.

The types of data we have a people, companies, and type of action.

Thanks!

最佳回答

You just need a timestamp (date and time) in every table holding a relevant information. For instance you can have a table with posts, a table with comments and one with shared links. Just join the three tables by user, order the rows by the timestamp than display it in your view.

If you need performance you can run a scheduled job to do this processing, in the background, then you can store the results in a ad-hoc table something like:

activity type: post

content: A title of...

timestamp: 2010-02-02 22:17:11

问题回答

Facebook uses something called MultiFeed for doing this. The API details this data type, but it is currently deprecated.

http://wiki.developers.facebook.com/index.php/MultiFeedStory_form





相关问题
Facebook Connect login dialog not working

I am using Facebook Connect for iPhone and following the official instructions. I use the following code to display the login dialog: FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:...

Facebook App Profile Tab is Empty ... No Content Displayed?

I can view my application via the http://apps.facebook.com/myapplication/ link and the content shows up correctly. I also added the application as a tab to a facebook page. However, when viewing the ...

Facebook Platform error: "Object cannot be liked"

I m working on a Facebook Application that generates wall posts. In testing these posts, I ve discovered that the Facebook Platform action of "liking" a post is failing. The specific error message ...

how to call showPermissionsDialog() in php (facebook api)?

I was reading over the documentation yet I could not figure out how to call Facebook.showPermissionsDialog() in php include_once ./facebook-platform/php/facebook.php ; $facebook = new Facebook(my ...

Facebook connect

If I plug in the facebook connect into my website, How can I prevent double signups? Lets say I have a user that s already signed up to my site but he clicked the connect with facebook, is there a ...

热门标签