SOA Patterns | Design Patterns | Atomic Service Transaction


SOA Patterns > Composition Implementation Patterns > Atomic Service Transaction
Home > Design Patterns > Atomic Service Transaction

Atomic Service Transaction (Erl)

How can a transaction with rollback capability be propagated across messaging-based services?

Atomic Service Transaction

Problem

When runtime activities that span multiple services fail, the parent business task is incomplete and actions performed and changes made up to that point may compromise the integrity of the underlying solution and architecture.

Solution

Runtime service activities can be wrapped in a transaction with rollback feature that resets all actions and changes if the parent business task cannot be successfully completed.

Application

A transaction management system is made part of the inventory architecture and then used by those service compositions that require rollback features.

Impacts

Transacted service activities can consume more memory because of the requirement for each service to preserve its original state until it is notified to rollback or commit its changes.

Architecture

Inventory, Composition

Atomic Service Transaction: As per the previous figure, Services A and B complete their respective tasks successfully. However each time they do, they initiate a local transaction, temporarily saving the current state of the database prior to making their changes (1, 2). After Service C fails its database update attempt (3), Services A and B restore their databases back to their original states (4, 5). The business task is effectively reset or rolled back across services within the pre-defined transaction boundary.

As per the previous figure, Services A and B complete their respective tasks successfully. However each time they do, they initiate a local transaction, temporarily saving the current state of the database prior to making their changes (1, 2). After Service C fails its database update attempt (3), Services A and B restore their databases back to their original states (4, 5). The business task is effectively reset or rolled back across services within the pre-defined transaction boundary.


Module 7: Advanced SOA Design & Architecture with Services & Microservices

This pattern is covered in SOACP Module 7: Advanced SOA Design & Architecture with Services & Microservices.

For more information regarding the SOA Certified Pofessional (SOACP) curriculum,
visit www.arcitura.com/soa.

SOA Design Patterns

This page contains excerpts from:

SOA Design Patterns by Thomas Erl

(ISBN: 0136135161, Hardcover, Full-Color, 400+ Illustrations, 865 pages)

For more information about this book, visit www.arcitura.com/books.