1

What's the relationship between the two?

Both are for atomic operations. Both results need to be either success, or failure with rollback to original state.

1 Answer 1

4

Both the saga and unit of work patterns intend to ensure consistency of related operations, but at different levels:

  • The saga pattern aims at ensuring consistency across independent services and without using a two phase commit.

  • The unit of work pattern aims at ensuring consistency (usually within a system) by making sure that the object states and the database states remain aligned according to a transactional logic (i.e database commit or two phase commit).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.