Scaling an application Facebook Developer’s Garage November 28 th  2007
The application <ul><li>Six degrees of separation </li></ul><ul><li>Original functionality consisted of: </li></ul><ul><li...
The application <ul><li>Six degrees of separation </li></ul><ul><li>Started as an R&D project with 1.5 days work </li></ul...
What’s scale? <ul><li>Currently 150,000k users </li></ul><ul><li>87 users after 2 days </li></ul><ul><li>2000 users after ...
What’s scale? Installs over time
How did it grow <ul><li>Nothing particularly spammy </li></ul><ul><li>No feeds or notifications used </li></ul><ul><li>The...
Overview of the code <ul><li>Version 1: </li></ul><ul><li>A handful of FBML pages </li></ul><ul><li>No iframes </li></ul><...
Week 1 – 2,000 users <ul><li>“ Wow, isn’t this fun!” </li></ul><ul><li>A few bugs to fix </li></ul><ul><li>Not a big deal ...
Beginning week 2 <ul><li>Things are starting to get slow </li></ul><ul><li>Kinks, what kinks? </li></ul><ul><li>Time to st...
Hack #1: Iframe tasks <ul><li>FBML is useful, but Facebook doesn’t wait around </li></ul><ul><li>Whereas the API may make ...
Week 2 – 10,000 users <ul><li>It’s getting busy </li></ul><ul><li>New features are placing new demands </li></ul><ul><li>A...
Hack #2: Calculating…
Upcoming SlideShare
Loading in …5
×

Scaling a Facebook Application

750 views

Published on

A presentation for the London Facebook Developer Garage in September 2009 on some of the troubles I faced in scaling the Six Degrees of Separation application.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
750
On SlideShare
0
From Embeds
0
Number of Embeds
152
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Scaling a Facebook Application

  1. 1. Scaling an application Facebook Developer’s Garage November 28 th 2007
  2. 2. The application <ul><li>Six degrees of separation </li></ul><ul><li>Original functionality consisted of: </li></ul><ul><li>Calculate how many degrees of separation from the user to me </li></ul><ul><li>Tell them about it </li></ul><ul><li>Tell them some other numbers </li></ul><ul><li>That’s it </li></ul>
  3. 3. The application <ul><li>Six degrees of separation </li></ul><ul><li>Started as an R&D project with 1.5 days work </li></ul><ul><li>Designed to test the end-to-end process of releasing an application </li></ul><ul><li>We didn’t expect it to go anywhere </li></ul><ul><li>Built in PHP on Windows, with SQL Server (to make use of views and triggers) </li></ul>
  4. 4. What’s scale? <ul><li>Currently 150,000k users </li></ul><ul><li>87 users after 2 days </li></ul><ul><li>2000 users after 1 week </li></ul><ul><li>9700 users after 2 weeks </li></ul><ul><li>128k users after 2 months </li></ul>
  5. 5. What’s scale? Installs over time
  6. 6. How did it grow <ul><li>Nothing particularly spammy </li></ul><ul><li>No feeds or notifications used </li></ul><ul><li>The sign-up process is: </li></ul><ul><ul><li>User sign-up </li></ul></ul><ul><ul><li>Shown results </li></ul></ul><ul><ul><li>Encouraged to invite friends “in order to connect better” </li></ul></ul>
  7. 7. Overview of the code <ul><li>Version 1: </li></ul><ul><li>A handful of FBML pages </li></ul><ul><li>No iframes </li></ul><ul><li>A lot of database triggers </li></ul><ul><li>User profiles updated in real time </li></ul>
  8. 8. Week 1 – 2,000 users <ul><li>“ Wow, isn’t this fun!” </li></ul><ul><li>A few bugs to fix </li></ul><ul><li>Not a big deal with scaling </li></ul><ul><li>Time to add a new feature: </li></ul><ul><ul><li>Search for other users </li></ul></ul>
  9. 9. Beginning week 2 <ul><li>Things are starting to get slow </li></ul><ul><li>Kinks, what kinks? </li></ul><ul><li>Time to streamline the API calls </li></ul><ul><li>… and the database </li></ul><ul><li>Use an iframe to perform ‘background’ tasks </li></ul>
  10. 10. Hack #1: Iframe tasks <ul><li>FBML is useful, but Facebook doesn’t wait around </li></ul><ul><li>Whereas the API may make you wait </li></ul><ul><li>Put tasks that may take time into an iframe </li></ul><ul><li>Pass parameters through the fb:iframe src </li></ul>
  11. 11. Week 2 – 10,000 users <ul><li>It’s getting busy </li></ul><ul><li>New features are placing new demands </li></ul><ul><li>Almost everything moved into iframes </li></ul><ul><li>The ‘Calculating…’ script </li></ul>
  12. 12. Hack #2: Calculating…

×