0Pricing
Microservices Communication Patterns (Saga, Circuit Breaker) · درس

الاختيار بين التنسيق والتوجيه الذاتي

قارن مباشرة بين نمطي saga، وتعلّم معايير عملية لاختيار التنسيق أو التوجيه الذاتي لسير عمل معين.

الاختيار بين التنسيق والتوجيه الذاتي درس مجاني في Microservices Communication Patterns (Saga, Circuit Breaker) على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Microservices Communication Patterns (Saga, Circuit Breaker)، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Microservices Communication Patterns (Saga, Circuit Breaker) 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Two Ways to Run a Saga

You have met both saga styles. Now the practical question: which one should you use? The choice shapes coupling, visibility, and operability of your whole workflow.

Quick Refresher

Choreography: services react to each other's events, no central brain. Orchestration: a central orchestrator explicitly tells each service what to do next.

Coupling

Choreography couples services only to event contracts — very loose. Orchestration centralizes flow knowledge in the orchestrator, coupling services to it but freeing them from knowing about each other.

Visibility of the Flow

With orchestration the entire workflow lives in one place — easy to read, trace, and reason about. With choreography the flow is emergent, scattered across event handlers, and harder to follow.

Debugging and Monitoring

Tracing a failure is simpler in orchestration: the orchestrator logs each step. In choreography you must reconstruct the path from distributed event logs, which gets painful as steps grow.

Adding Steps Later

Adding a step in choreography can mean changing several services that emit/consume events. In orchestration you usually change only the orchestrator, leaving participants untouched.

Risk of Cyclic Dependencies

Choreography can drift into hard-to-spot event cycles where services trigger each other in loops. Orchestration's explicit flow makes such cycles obvious and avoidable.

Single Point of Failure

The orchestrator is a potential bottleneck and single point of failure (mitigated by making it stateless and replicated). Choreography has no such central component.

A Rule of Thumb

Practical guidance:

  • Few steps, simple flow → choreography
  • Many steps, complex branching, needs visibility → orchestration

Hybrid Approaches

Real systems often mix both: orchestrate the complex core workflow, while letting peripheral concerns (analytics, notifications) react to events choreographically. Pick per workflow, not per system.

Team and Org Factors

Conway's law applies: independent teams may prefer choreography to avoid a shared orchestrator. A platform team that owns the workflow may prefer the central control of orchestration.

Quick Check

Test your decision-making.

Recap

You can now choose a saga style:

  • Choreography = loose coupling, emergent flow; orchestration = central control, clear visibility
  • Orchestration eases debugging, adding steps, and avoiding cycles
  • It introduces a central component to keep resilient
  • Few simple steps favor choreography; many complex steps favor orchestration
  • Hybrids are common — decide per workflow

الأسئلة الشائعة

هل درس «الاختيار بين التنسيق والتوجيه الذاتي» مجاني؟

نعم — نص درس «الاختيار بين التنسيق والتوجيه الذاتي» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Microservices Communication Patterns (Saga, Circuit Breaker)، انتقل إلى CoddyKit PRO. تتضمن دورة Microservices Communication Patterns (Saga, Circuit Breaker) 4 دروس في المجموع.

ماذا ستتعلم في «الاختيار بين التنسيق والتوجيه الذاتي»؟

قارن مباشرة بين نمطي saga، وتعلّم معايير عملية لاختيار التنسيق أو التوجيه الذاتي لسير عمل معين. تتمرن على Microservices Communication Patterns (Saga, Circuit Breaker) مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Microservices Communication Patterns (Saga, Circuit Breaker)؟

لا تُشترط خبرة سابقة. Microservices Communication Patterns (Saga, Circuit Breaker) على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «الاختيار بين التنسيق والتوجيه الذاتي»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Microservices Communication Patterns (Saga, Circuit Breaker) هذا؟

نعم. كل درس في Microservices Communication Patterns (Saga, Circuit Breaker) يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. ما نمط Saga؟
  2. شرح Saga بالتنسيق اللامركزي
  3. شرح Saga بالتنسيق المركزي
  4. الاختيار بين التنسيق والتوجيه الذاتي
← العودة إلى Microservices Communication Patterns (Saga, Circuit Breaker)