Course contentsShow
← Software Engineering
Lesson 1374 of 1,93340. Event-Driven ArchitectureFree lesson

Choreography: Decentralized Collaboration

How choreography enables services to react to events independently without central coordination.

Choreography: Decentralized Collaboration

What you'll learn: How services collaborate independently by reacting to events without a central coordinator telling them what to do.

The Core Idea

In choreography, each service watches for events it cares about and decides for itself what to do next—no single service acts as a "boss" orchestrating the workflow. Think of it like dancers in a choreographed routine: each performer knows their part and reacts to the movements of others without a conductor standing on stage directing every step.

Instead of a central orchestrator sending commands ("now you do this, then you do that"), services publish domain events ("order placed," "payment received") and interested services listen and respond autonomously.

How It Works

When an event occurs, any service that subscribed to that event type receives it and performs its own logic independently. For example:

  • Order Service publishes "OrderPlaced" event
  • Inventory Service listens for "OrderPlaced" and reserves stock
  • Notification Service also listens for "OrderPlaced" and sends confirmation email
  • Billing Service listens for "OrderPlaced" and creates an invoice

Each service decides independently whether and how to react. No single service knows or controls the complete workflow—the saga emerges from the collective behavior of all participants.

Benefits and Trade-offs

Choreography eliminates single points of failure and tight coupling that orchestration introduces. Services remain loosely coupled and can be added or removed without updating a central coordinator.

However, the workflow logic becomes implicit and distributed across multiple services, making it harder to understand the full saga flow. Monitoring and debugging require piecing together events from multiple sources.

Key Takeaway: Choreography enables truly decentralized collaboration where services react to events independently, trading centralized control for looser coupling and greater autonomy.