Here are some links and notes from recent presentations on how to scale a facebook application, both in terms of the technical infrastructure and the design of the application.
For the application design see this link to the great highscalability blog
In addition to the above, here are some notes I took from a talk Blake Commagere (developer of the popular Vampires Facebook application) gave two weeks ago at the Facebook developer meetup.
- Jealousy, Courtship, Selfishness, Sexuality motivate everything
- Help users meet someone they have chemistry with.
- Virality kicks in when you play to the users's selfishness. Tell the user what's in it for them
- Conversion of the invited is more important than the number of invitations. Try to convert the invited at the first invite, diminishing returns after that. So have to give the invited an appeal to selfishness as well.
- News feed is the most important viral mechanism - much more important than invites, as its viral beyond the invite list.
For the infrastructure discussion see this
The nginx + mongrel + memcached + rails stack seems to be the emerging best practice for rapid application deployment in the web community. I use almost the exact same stack for www.searchartgalleries.com, except my whole configuration is on one Xen slice at Slicehost since I have less traffic. I've been pleasantly surprised at how well my 1GB Xen slice performs - its faster than the 2 core, 2GB dedicated machines I use in my test and dev environment. I'm assuming this is because the slice is on a 4 core machine with a larger RAID configuration behind it, and I'm grabbing more cores and spindles when heavy requests come in. Slicehost has been a great VPS provider, although I have only 4 months of history so far the price performance has been excellent. SearchArtGalleries is mostly disk bound when pulling complex searches out of Mysql. The nice thing about this stack is that each layer scales out easily, nginx being a good load balancer and static file server all in one. The exception is the database - wouldn't it be nice if scaling Mysql was as easy as adding mongrels?
Now back to trying to figure out how to get my app to 4 million users by the end of next week :-)