CLOUD CONCEPT

Choreography

Choreography is a distributed coordination pattern in which services react to events and decide their own actions without a central workflow controller.

Cloud Concepts Hub →

What is Choreography

In choreography, a business process emerges from interactions among autonomous services rather than from instructions issued by one coordinator. It supports loosely coupled, independently scalable applications, but requires deliberate handling of message delivery, partial failures, and end-to-end visibility.

Choreography distributes coordination across the services participating in a business process. Each service consumes relevant events, applies its own business rules, updates its local state, and may publish additional events. No single component defines and controls every step of the overall workflow. Events normally describe facts that have already occurred, such as OrderPlaced or PaymentAuthorized, rather than instructions telling another service exactly what to do.

Consider an online store. The order service records an order and publishes OrderPlaced. The payment service reacts by attempting authorization and publishing PaymentAuthorized or PaymentDeclined. The inventory service reacts to PaymentAuthorized by reserving stock and publishing InventoryReserved or InventoryUnavailable. Shipping reacts when its required business conditions are satisfied. Each service owns its local behavior, while the sequence of events connects those behaviors into a larger process.

Cloud implementations commonly use an event bus or publish-subscribe topic to distribute events, with a separate queue for each consuming service when buffering and independent retry are needed. Functions, containers, or other application workers execute the handlers. A shared messaging platform does not make this orchestration: routing messages is different from centrally deciding which business step must run next. Conversely, using asynchronous messages does not automatically make a workflow choreographed if a controller still directs every step.

Reliable implementation requires attention to delivery semantics. Messages can be duplicated, delayed, or received out of order, depending on the transport and configuration. Handlers should use idempotency keys and durable processing records so that retries do not repeat effects such as charging a customer. A transactional outbox can address the failure window between committing a database change and publishing its event by recording both the change and an outgoing event in one local transaction. The publication mechanism still requires retry handling and duplicate-safe consumers.

Choreography typically produces eventual consistency across service boundaries rather than one atomic transaction spanning all participants. If inventory reservation fails after payment authorization, services may react to failure events by releasing reservations or voiding an authorization. These compensating actions represent business recovery, not a database rollback, and can themselves fail or require manual intervention. A choreography-based saga is one application of the pattern, not a synonym for all choreography.

The main benefits are independent deployment, flexible subscription, and reduced direct dependencies between producers and consumers. The costs include less obvious control flow, event-contract dependencies, harder integration testing, and more difficult diagnosis of incomplete processes. Use correlation identifiers, documented event schemas, bounded retries, dead-letter handling, and business-level progress monitoring. For architecture questions, distinguish choreography from orchestration, which places coordination in a controller, and from fanout, which simply distributes one message to multiple recipients. Event-driven architecture is broader than choreography, and neither microservices nor asynchronous messaging requires this coordination pattern.

Key aspects of Choreography

Choreography combines autonomous event handlers with explicit contracts, resilient message processing, and distributed recovery and observability.

Decentralized business coordination

Each participating service determines its response to incoming events. A broker can centralize message transport without becoming the owner of the business workflow.

Event-based contracts

Producers publish facts without needing to know every consumer. Define event meaning, ownership, and schema evolution rules so independently deployed services remain compatible.

Independent consumption and scaling

Separate subscriptions and consumer queues allow services to process the same business event at different rates. Multiple workers on one queue share work; separate queues are needed when different services must each receive a copy.

Duplicate-safe processing

Design handlers to tolerate retries and duplicate deliveries using stable event identifiers and durable idempotency controls. Do not assume broker deduplication guarantees exactly-once business side effects.

Local transactions and compensation

Services commit their own state independently, so the overall process can be temporarily inconsistent. Model failure events and compensating actions explicitly when later failures must undo earlier business effects.

Cross-service observability

Propagate correlation identifiers and record meaningful state transitions across services. Monitor stalled business processes as well as queue depth, handler failures, and dead-letter messages.

Cloud services for Choreography

An application service can publish business events to EventBridge, whose rules route relevant events to separate SQS queues for downstream services. Alternatively, SNS can fan out an event to multiple consumer queues. Lambda functions or other workers process each queue, apply local business rules, persist state, and publish resulting events. The application remains choreographed when consumers decide their own next actions rather than following a central workflow controller. Configure delivery-failure handling and consumer-processing recovery separately, since failure to reach a target differs from failure inside its handler. Across either arrangement, use idempotency controls, correlation identifiers, and compatible event contracts.

Amazon EventBridge image Amazon EventBridge

EventBridge event buses route published events to matching targets using rules. They support choreography by distributing business facts while leaving each consuming service responsible for its own decisions.

Open Amazon EventBridge →
AWS Lambda image AWS Lambda

Lambda functions can implement autonomous event handlers that update service-owned state and publish outcome events. With SQS event source mappings, configure partial batch responses when appropriate so successfully processed records are not retried because another record failed.

Open AWS Lambda →