Demo: scaling inventory to three replicas
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
scale out behind Compose DNS and watch a replica die. Prepares MID-036-LAB1.
Draft outline details
Step by step
- Start Shop with
docker compose up --scale inventory=3; remove fixed host port mappings frominventory. - Call
inventoryfromordersrepeatedly and log the replica's hostname; show requests spread across three. - Run a load test; kill one replica mid-run.
- Planned mistake: hard-code one replica's IP in
ordersconfig. When that replica dies, every call fails. Fix: use the service name. - Show errors limited to requests in flight on the killed replica; explain why (already sent, not yet rerouted) and how retries on idempotent calls plus graceful shutdown reduce it.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.