Dan Catt has written part one of a users guide to websites. It explains why sites with “social” features are so difficult to scale beyond a few hundred users and the necessary compromises made that piss off the sites’ vocal power users. Excellent stuff.
That cool “user-who-did-x-also-did-y” feature was calculated whenever you visited your homepage. This worked for the 500 initial users (the site’s builders and their friends) but started to take too long when they hit 1,000 users.
The site solved this by caching (storing the results for an amount of time) the calculations. The users complained that they were being shown incorrect data because everyone they knew was doing stuff all the time and it wasn’t updating fast enough.
The site solved this by invalidating (removing the stored results so they need to be recalculated) the cache whenever anyone did anything. The site hits 5,000 users and the cache is being invalidated every sodding second … the homepage takes too long to load.
The site solves this by writing their own custom code for managing off-line tasks and puts everything into a task queue to be processed.
98% of users accept that the section that used to be called “What your friends are doing right now” gets changed to “What your friends have recently been doing”. The other 2% of users throw a tantrum and accuse the site of being run by useless gibbering idiots.