نماذج القراءة وCQRS المبسّط
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
serve queries from a dedicated read model inside one service.
الموضوعات المخطط لها
- CQRS-lite: separate the write model (entities, rules) from a read model (tables or views shaped for queries), in the same service and database.
- Update the read model in the same transaction, or from domain events after commit, or by periodic refresh.
- Choose by staleness tolerance: same transaction is consistent; events are eventually consistent.
- No event sourcing and no separate database is needed for simple cases.
- Include a rebuild path: recompute the read model from the write tables.
تفاصيل المخطط المبدئي
عرض عملي
a diagram: POST /orders writes orders and publishes OrderPlaced; a listener updates dashboard_daily(day, orders, revenue); GET /admin/dashboard reads only that table.
اختبر فهمك
Does CQRS-lite require event sourcing?
أظهر الإجابة
No.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.