Module 95: Scaling

Lesson 5 of 5 · 15–25 minutes

Asynchronous work and scaling costs

🏠The everyday picture

A restaurant takes your order and payment at the counter in a minute, while the slow cooking happens in the kitchen. If every customer had to wait at the counter while their food cooked, the queue would stretch down the street.

📘What it really is

🖱️Try it

Move image resizing and invoice PDF generation in the booking platform into background jobs, and scale workers separately in Compose. Re-run the load test and compare booking latency. Calculate the cost per thousand bookings for your current set-up, and for a set-up that handles 10 times the traffic, using your provider's prices.

✅Quick check

What belongs in the request path, and what doesn't?

Show the answer

Only what the user must wait for (validation, saving, reservation); slower side work goes to background jobs.

Why measure cost per unit, such as per booking?

Show the answer

It shows whether growth is affordable and which changes actually save money.

← PreviousScaling the database
ProLearners Assist