How to Approach
- Understanding the user requirements
- Coming up with a high level design
- Scaling the design
Notes from harvard scalability lecture
- Vertical scaling means adding more RAM/CPU etc.
- this will have physical limits and might blow your budget
- Horizontal scaling means we can use cheaper less capable hardware, but more of them
Components
Load balancer
Spread out requests across several servers, each of which maintains a replica of our application server.
DNS round robin
Each DNS request can be used to send a different IP address. So each new request will go the next available sever. Can use something like BIND(Berkely Internet Name Daemon). Google uses something like this?
Limitations
- Does not take into account load of each server
- DNS responses will likely be cached on client, so a high traffic client will likely keep hitting the same server with every request, so in that case this technique will not help us
1 | ________________ |
- HTTP(S) load balancing
Reference
More about HTTP Headers
Load balancing concepts
Reverse proxy
Message Brokers
- https://content.pivotal.io/blog/understanding-when-to-use-rabbitmq-or-apache-kafka
- https://www.youtube.com/watch?v=XjuiZM7JzPw
Reverse Proxies
Example: Design Pinterest
Users
Constraints
High level design
Real life examples
Aman many more good ones at QCON!