Scalability
Horizontal scaling adds workers while vertical scaling changes resource size. Identify the limiting resource and load pattern; adding web replicas cannot repair a saturated single database. Each worker handles 50 requests/second, so four workers offer an approximate 200 before shared limits. A database capped at 120 writes/second remains the bottleneck even after eight workers are added.
Each worker handles 50 requests/second, so four workers offer an approximate 200 before shared limits. A database capped at 120 writes/second remains the bottleneck even after eight workers are added.
Throughput is completed work per time unit; vertical scaling increases one node's capacity; horizontal scaling adds nodes. Imagine a stateless API has many parallel reads but each request acquires a single global lock. More replicas may add contention rather than proportional throughput. Measure the request path and identify whether CPU, I/O, a lock or a downstream quota limits completion. Estimate per-worker capacity under the same workload and verify that a scale-out experiment preserves correctness. A load balancer distributes work but does not eliminate shared bottlenecks. Horizontal growth improves independent worker capacity and failure isolation, while adding coordination and deployment complexity. Choose the change that targets the measured limiting mechanism, and define the next bottleneck expected after it improves. Reestimate shared-resource limits after scaling.
A database capped at 120 writes/second remains the bottleneck even after eight workers are added.
Adding web replicas always fixes a saturated database.