عرض عملي: قراءة ما كتبته عبر الخدمات (read-your-writes)
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
reproduce a stale read after checkout and fix it. Prepares MID-030-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- 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.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.