CQRS بالتفصيل
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
separate the write model from the read model when their needs really differ.
الموضوعات المخطط لها
- Command side protects invariants; query side is shaped for screens and reports.
- CQRS-lite: same database, separate classes or views; often enough.
- Full CQRS: separate stores kept in sync by events; reads are eventually consistent.
- Use full CQRS when read load, shape, or scaling differs sharply from writes.
تفاصيل المخطط المبدئي
عرض عملي
a diagram: commands -> aggregate -> write DB -> outbox -> events -> projector -> read store (search or denormalized tables) -> query API. Beside it, the CQRS-lite version with a SQL view.
اختبر فهمك
When is CQRS-lite enough?
أظهر الإجابة
When one database can serve both sides within latency and scale needs; only the code is separated.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.