What is horizontal and vertical scalability or horizontal scalability vs vertical scalability

Consider a popular online retail website that experiences a surge in traffic during holiday seasons.

Horizontal Scalability: The website can handle increased traffic by deploying additional web servers behind a load balancer. As the number of users increases, more servers are added to the pool, allowing the system to distribute the load evenly across multiple instances.

Vertical Scalability: Alternatively, the website could upgrade its existing servers by adding more powerful CPUs and increasing RAM capacity. With enhanced hardware resources, each server can handle a greater number of concurrent users and process more transactions without needing to add more machines.

Both horizontal and vertical scalability aims to ensure that the system can accommodate growing demands effectively, but they differ in their approach to achieving scalability. Horizontal scalability emphasizes distributing the load across multiple entities, while vertical scalability focuses on enhancing the capabilities of individual entities.