Apps that don't scale (Fb, twitch, google) stories
Tags: watercooler, development, discuss, motivation
Published: 2022-04-05 00:59:11

Do you overthink making your yet-to-be-made app scalable? Great, you're not the only one, but should you?
Here are some scalability stories from the famous tech that you use every day. 

Hope you'll find them insightful.




## 1) Facebook
As Facebook started as a little Stanford project and then started scaling the university campus-wise. Do you know how they used to do that? 
Facebook used to have a separate server for each campus with each having its own code, MySql database, and memecache. Each time FB need to have another campus they would install a new server with its own server, code, and database.
Each user was restricted to its own campus, they would have a weird "harvard.facebook.com" type URL for each user.

Later when they decided to let different campus users talk to each other, it took them a year to come up with an efficient so-called single-global-table, where users can add each other globally.


## 2) Gmail
yeah I mean the defacto standard for emails, Gmail. Do you how it was initiated & scaled?
A guy name Paul Buchheit from google didn't like to use existing email clients because he wasn't satisfied with their UI. So he hacked together a little tool to just preview his emails in google groups UI & he liked it. Then he started adding little new features when he feel like it should have something else, like let's add a writing emails option, a delete button...

One day he showed his created little email client to his co-worker and he kinda likes it, but the problem was he wasn't able to use his email in it because Paul's email was hardcoded in it. Paul just realized he should make it flexible to allow for other emails to be used instead of his one.
People start to use it inside google, a day it went down & someone came to Paul and said, do you know Gmail has been down since morning. He said no, I was busy with work didn't know that :D


## 3) Twitch
Initially, video streaming cost was very high when twitch started, every little detail on their web page will fire a query to get data, e.g watch count, likes count, etc
They decided to cut the cost by loading all website data in cache except video and chat. Therefore video was played but none of the buttons was interactive except chat. All those data were being loaded from local storage.
Later they figure out a way to cache using different strategies.


## 4) Google
At some point google's algorithm to crawl pages become inefficient, it would take 3 weeks to crawl new pages.
Google stopped crawling new pages for 6 months & showed only the old crawled pages to users on search. The cool part was users didn't even notice that.


## 5) Friendster vs MySpace
Friendster used to have a feature to show you how far this connection is from you. But this little so-called important functionality was very expensive. It will fire a query for each user-friend multiple times to figure out by going through existing connections to figure out how this person is linked with the current user. This functionality would fire tons of queries & took a lot of time.
Myspace used the same feature but instead of finding a connection through multiple queries, they would fire a single query if the person is your friend otherwise they would show text, "this is your far connection" :D

Source: Y Combinator

> Conclusion is, Don't stress too much about scaling before you even start, rather start small & scale with the time.
Do you know any similar stories? Please let us know in comment 👇