Skip to content
October 8, 2013 / binidas

Saga Pattern

While working on distributed system focus our effort on designing low latency and managing consistency across the systems. As the standard practise of SOA architecture the single responsibility principle is best implemented by breaking down the monolithic systems into multiple systems which has its own unit of work or services or business process.

This boils down to need for managing distributed system with various states which can have long running processes or workflows across various services. Such reactive systems with state machine have to manage fault tolerance ensuring at any point in time there is no inconsistency of data across and to reduce long running transactions. The way its done by keeping the communication short and handling failures with compensation. Saga architecture pattern can be introduced to design such state machine.

Jimmy Bogard explains it in pretty good example which can be implemented in real life scenarios. As Jimmy Bogard explains in his blog about ObserverController and Command patterns used in designing Saga implementation.

He also further details about how Process Manager pattern from Enterprise Integration pattern brings on resource contention and starvation.

Having said that route slips can be used when no centralised controller is required. This is applied when steps to next process is known, routine slip will provide better solution which prevent shared state as in process manager pattern.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: