Demo: read-your-writes across services
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
reproduce a stale read after checkout and fix it. Prepares MID-030-LAB1.
Draft outline details
Step by step
- Place an order through
orders; thecatalogview of "my recent purchases" is fed by Kafka and lags by a second. - Immediately call
GET /my/purchasesand observe the new order missing. - Planned mistake: add
Thread.sleep(2000)in the client. It works on a quiet laptop and fails under load. Fix: do not guess lag. - Return the created order in the POST response and have the UI merge it into the list until the read model catches up.
- Alternative: send the order version with the read; the service waits briefly or falls back to the source of truth.
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.