Menu

Saga in microservices: orchestration or choreography?
📰

Saga in microservices: orchestration or choreography?

DEV Community: microservices·Denis Toropov·about 11 hours ago
#mNHN3HPm
#devtomicroservices#devto#dev#process#payment
Reading 0:00
15s threshold

Most of you have probably heard of the Saga pattern in microservice architectures. It helps coordinate a business process that spans multiple services and cannot be handled by a single transaction.

Each participant in a Saga commits a local change. If a later step fails, the system runs compensating actions to bring the process back to an acceptable state. But who should manage the sequence of steps: the services themselves, or a dedicated coordinator?

Orchestration or choreography?

With choreography, services react to one another’s events, and there is no central coordinator. With orchestration, a dedicated coordinator defines the order of actions, tracks the process state, and decides what to do when something fails.

The choice depends on the complexity of the business process and the level of control it requires. Let’s compare both approaches using the same example.

Example: placing an order

Choreography: services react to events

Consider an order workflow.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.