I'm writing a social app in Django where all users sign up through Facebook using Python Social Auth. All content that a user sees will be content created by her Facebook friends. Initially, I planned on creating individual users with no database relationship to each other, and relying on requests to Facebook to determine what content to display for each user. Now I'm concerned that this might be a bad idea.
Here's what I've considered:
Advantages
- Less database management
- Don't have to worry about updating friends when two users become friends or cease to be friends
Disadvantages
- Requires many requests to Facebook which could be a performance issue
- Seems like it could run into scaling issues
Is this a bad idea? Should I be storing these friendships in my own database and referencing them there?
-
1don't forget the ultimate kicker for your app - there are a lot of people who don't use Facebook, or do not trust Facebook to manage non-FB sites. I wouldn't use your app at all if the only login option was FB.gbjbaanb– gbjbaanb06/16/2016 09:38:17Commented Jun 16, 2016 at 9:38
1 Answer 1
Caching the user/relationship data locally will certainly make your application much faster because your backend doesn't need to perform as many time-consuming queries on the facebook API on every single request.
Also keep in mind this clause from the Facebook API service terms:
11.If you exceed 5M MAU, 100M API calls per day, or 50M impressions per day, you may be subject to additional terms.
That means that when you have more than 100 million API calls per day, they might send you a bill of undetermined size and threaten to cancel your API access when you don't pay up. We don't know anything about the scale of your operation, but when you avoid doing multiple API calls on every single page request you can considerably increase the scale on which that restriction becomes a problem.
-
100m calls.... Kind of sounds like a lot, but at the same time, it does seem very possible to get past that. What exactly do they determine as a "Impression" and wtf is a "MAU?"XaolingBao– XaolingBao06/16/2016 13:42:54Commented Jun 16, 2016 at 13:42
-
1@Lasagna MAU = Monthly Active Users. The impression count is relevant for facebook apps which are embedded within facebook.Philipp– Philipp06/16/2016 13:46:32Commented Jun 16, 2016 at 13:46
-
Thanks for that, had to look up what an impression was, so that was my bad. 50m seems like a lot of impressions, I would think API calls would be the biggest worry.XaolingBao– XaolingBao06/16/2016 13:49:53Commented Jun 16, 2016 at 13:49
Explore related questions
See similar questions with these tags.