https://github.com/G33kzD3n/Catalogue/blob/master/System Design Interview An Insider’s Guide by Alex Xu (z-lib.org).pdf

Chapter 1: Scaling from Zero to Millions of Users

Scaling a system is an iterative process. Iterating on what we have learned in this chapter could get us far. More fine-tuning and new strategies are needed to scale beyond millions of users. For example, you might need to optimize your system and decouple the system to even smaller services. All the techniques learned in this chapter should provide a good foundation to tackle new challenges. To conclude this chapter, we provide a summary of how we scale our system to support millions of users:

Keep web tier stateless

Now it is time to consider scaling the web tier horizontally.

For this, we need to move state (for instance user session data) out of the web tier. A good practice is to store session data in the persistent storage such as relational database or NoSQL. Each web server in the cluster can access state data from databases.

Cache data as much as you can

Here are a few considerations for using a cache system:

Support multiple data centers

Several technical challenges must be resolved to achieve multi-data center setup: