الحياة دون ربط بين الخدمات
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
replace joins with three techniques.
الموضوعات المخطط لها
- API composition: call each service and combine results in a gateway or backend-for-frontend; fine for small result sets.
- Events and local copies: keep a read-only copy of the fields you need, updated by events; it can be briefly stale.
- Denormalize at write time: store a snapshot, e.g. product name and price in the order line.
- Large reporting joins belong in a separate read model or analytics store.
- Accept that each choice trades freshness, coupling, and cost.
تفاصيل المخطط المبدئي
عرض عملي
order history screen: orders stores productName and unitPrice snapshots, so no call to catalog is needed.
اختبر فهمك
Why snapshot price in the order line?
أظهر الإجابة
The price at purchase time must not change, and it avoids a catalog call.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.