Module 70: Cloud Deployment

Lesson 4 of 5 · 15–25 minutes

Scaling

🏠The everyday picture

A restaurant facing a queue can get a bigger stove (scale up) or open a second counter (scale out). The second option keeps working even if one counter breaks.

📘What it really is

🖱️Try it

Check your API is stateless: list anything stored in memory or on local disk, and move it if needed. In Compose, run two copies of the API (docker compose up -d --scale api=2, with Nginx load balancing to both via an upstream). Run a simple load test with k6 against staging and note requests per second and error rates.

✅Quick check

What does "stateless" mean for horizontal scaling?

Show the answer

No user data is kept only in one copy's memory or disk, so any copy can handle any request.

What's usually the bottleneck when an app gets busy?

Show the answer

The database; fix queries, indexes, caching and connection pooling first.

← PreviousDeployment methods
ProLearners Assist