Horizontal Scaling

Horizontal scaling means running multiple instances of an application and distributing traffic among them. This improves capacity and can improve availability when instances are independently replaceable.

Stateless application servers make horizontal scaling easier. If state must be shared, use an external system such as a database, cache, or message broker rather than relying on process-local memory.

Horizontally Scaled Node.js Service
Key Takeaways
  • Stateless services are easier to scale horizontally.
  • Shared state should live in appropriate external infrastructure.
  • Load balancing distributes traffic across healthy instances.
Knowledge Check

Why are stateless Node.js servers easier to scale horizontally?