Why use Saga over Process manager?

1,362 views
Skip to first unread message

Lap Ming Lee

unread,
Aug 13, 2016, 12:13:23 AM8/13/16
to DDD/CQRS
After reading the difference between a saga and process manager/ workflow, I came to an understanding that both concepts are different.  I have implemented a workflow pattern for my server, but I want to know what is the distinct advantage of using a saga pattern over the workflow pattern.  It seems like a saga pattern can utilizing the workflow pattern.  And both saga and workflow patterns can be implemented separately.  

In the end, both patterns appear to do exactly the same thing.   Both can be implemented to be idempotent (especially if you are using something like Kafka to pass messages).  The only difference in implementation is that one uses a central node to maintain the overall state of each process and the other passes a routing slip between affected nodes. 

Does it matter I use a workflow pattern instead of a saga pattern?  What are the long term consequences in a distributed server? 


Greg Young

unread,
Aug 13, 2016, 5:23:23 AM8/13/16
to ddd...@googlegroups.com
One is stateless the other stateful. One is immutable the ither is
mutable. One can change things while they are running the other sets
out from the beginning the full path. There are tons of differences.
> --
> You received this message because you are subscribed to the Google Groups
> "DDD/CQRS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dddcqrs+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Studying for the Turing test

Lap Ming Lee

unread,
Aug 15, 2016, 12:52:40 AM8/15/16
to DDD/CQRS
Hi Greg, 

Thanks for replying.  From my understanding of your response, it seems like both are used in different use-cases.  Can you list an example when you would choose on over the other?   

This article (http://arnon.me/2013/01/saga-pattern-architecture-design/) mentions that the different between a saga pattern vs workflow pattern is in the architectural design, but for intent they are the same. 

When I mention the workflow pattern, I am referring to a saga pattern using a process manager.  Specifically, I implemented the pattern in this image in the talk 


This workflow pattern using a "Saga Execution Coordinator (SEC)" to manage the process, which is not technically what a saga pattern should be.   

Reply all
Reply to author
Forward
0 new messages