Reputation: 3568
I have to integrate Social Networks such as Facebook etc. to display items that have been read or clicked or commented by users' friends. Some architecture questions arise :
questions : a) should I cache the user's friend list in my app db ? The downside is that the list of users friends could change. Or should I fetch this list after every login ?
b) When a user logs in to my app ( using oauth) , what is the best way to fetch his/her friends list -- should I do that in the web request thread, which is where I am making locs to our local db, or should I spawn a different task / thread/ batch job to fetch this list ?
c) user thumbnail images : if a user logs in , should I cache the user profile thumbnail picture and serve it from my app or should I just embed the profile pic url ( pointing to the social site) on the page?
Upvotes: 2
Views: 107
Reputation: 10215
I've never integrated with Social Networks (SN) before so my advice is going to be general (sorry).
A) Caching
B) OAuth
If you can do it asynchronously then it's probably not a bad idea. You have no control over the target system, so what do you do when things don't go well? You'd probably want to make this as simple as possible; I don't know much about working asynchronously except using AJAX (but this sounds like you're in the back-end?), so I'm not sure of specifics.
C) Thumbnails
Upvotes: 1