الإسقاطات (Projections) واللقطات (Snapshots) والترقية (Upcasting)
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
keep an event-sourced system fast, rebuildable, and evolvable.
الموضوعات المخطط لها
- A projection is a read model built by consuming events; it must be rebuildable from the log.
- A snapshot stores state at version N so replay starts there, not at zero.
- Upcasting converts old event versions to the current shape when reading.
- Track projection position (checkpoint) and make handlers idempotent.
تفاصيل المخطط المبدئي
عرض عملي
outline: ShipmentDelivered v1 (no signature field) upcast to v2 with signature=null on read; a checkpoint table (projection name, last position); snapshot every 100 events.
اختبر فهمك
Why must projection handlers be idempotent?
أظهر الإجابة
Because rebuilds and retries deliver the same event more than once.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.