What happens next 1 Calls Client 5 Calls

  • Slides: 23
Download presentation
What happens next? (1) Calls Client (5) Calls (3) Calls Flight Booking (2) Change

What happens next? (1) Calls Client (5) Calls (3) Calls Flight Booking (2) Change DB SOA-33: Transactions in a SOA World Hotel Booking (4) Change DB Car Booking (6) Fails

SOA-33: Transactions in an SOA World (Practical Examples) Mike Ormerod Applied Architect SOA-33: Transactions

SOA-33: Transactions in an SOA World (Practical Examples) Mike Ormerod Applied Architect SOA-33: Transactions in a SOA World

Definition : Transaction “A transaction is a set of related changes to the database

Definition : Transaction “A transaction is a set of related changes to the database that the database either completes in its entirety or discards, leaving no modification to the database. ” Open. Edge® Development: ABL Handbook SOA-33: Transactions in a SOA World

ACID Properties § Atomic – All or nothing § Consistent – Start & End

ACID Properties § Atomic – All or nothing § Consistent – Start & End in a Consistent state § Isolated – transactions appear isolated from all other operations § Durable – once notified, the transaction will persist SOA-33: Transactions in a SOA World

Definition : Distributed Transaction “A distributed transaction is a single transaction that updates two

Definition : Distributed Transaction “A distributed transaction is a single transaction that updates two or more databases. ” Open. Edge Data Management: Database Admin SOA-33: Transactions in a SOA World

SOA Transactions § Functionality separated into Services • Application comprises many Services § Services

SOA Transactions § Functionality separated into Services • Application comprises many Services § Services as a separate platform § System Independent Entities SOA-33: Transactions in a SOA World

SOA Transaction Issues § Multiple services resulting in multiple endpoints § Loosely coupled systems

SOA Transaction Issues § Multiple services resulting in multiple endpoints § Loosely coupled systems • Maintaining Txn’s only possible in closely coupled systems § Services based on any platform § Resources can’t be kept in a locked state § Alternate Recover methods ARCH-13: Transactions in an SOA World

What’s needed § Uniquely identify transaction across services § Guarantee that data is delivered

What’s needed § Uniquely identify transaction across services § Guarantee that data is delivered and notifications sent § Some form of compensation for when it goes wrong § Handle errors in asynchronous services SOA-33: Transactions in a SOA World

Possible Solutions 1. Compensation 2. Transaction Coordinator SOA-33: Transactions in a SOA World

Possible Solutions 1. Compensation 2. Transaction Coordinator SOA-33: Transactions in a SOA World

Definition : Compensation “Compensation is an action taken when something goes wrong or when

Definition : Compensation “Compensation is an action taken when something goes wrong or when there is a change of plan. ” IBM Systems Journal– April 2002 SOA-33: Transactions in a SOA World

Compensation (7) Error/Exception thrown (12) Call Compensation (1) Calls Client (9) Call Compensation (5)

Compensation (7) Error/Exception thrown (12) Call Compensation (1) Calls Client (9) Call Compensation (5) Calls (3) Calls Flight Booking (14) Return Failure (2) Change DB Hotel Booking (11) Return Error (4) Change DB (10) Apply Compensation SOA-33: Transactions in a SOA World Car Booking (8) Return error (10) Apply Compensation (6) Fails

Compensation Issues § Asynchronous services § Where to store state details SOA-33: Transactions in

Compensation Issues § Asynchronous services § Where to store state details SOA-33: Transactions in a SOA World

Definition : Transaction Coordination “Orchestration of transactions through a transaction manager or process coordinator.

Definition : Transaction Coordination “Orchestration of transactions through a transaction manager or process coordinator. ” SOA Systems – Feb 2007 SOA-33: Transactions in a SOA World

Coordination Advantages § Fixes Asynchronous issues of Compensation § Manages state & service information

Coordination Advantages § Fixes Asynchronous issues of Compensation § Manages state & service information § Central management of transaction & compensation SOA-33: Transactions in a SOA World

Coordination Service (1) Call Coordinator Service Client (17) Return Fail (2) Call (4) Return

Coordination Service (1) Call Coordinator Service Client (17) Return Fail (2) Call (4) Return (5) Call (14) Call (8) Call (10) Return (16) Return (11) Call (13) Return Fail Compensation Service 3 Service 2 Service 1 (3) Change DB (7) Return (6) Change DB (15) Apply (12) Apply Compensation SOA-33: Transactions in a SOA World (9) Fails

Open. Edge Reference Architecture Presentation Enterprise Services Data Access Data Sources SOA-33: Transactions in

Open. Edge Reference Architecture Presentation Enterprise Services Data Access Data Sources SOA-33: Transactions in a SOA World Common Infrastructure Business Components

Vacation Booking - ABL (1) Call Coordinator. Workflow Service Business Client (17) Return Fail

Vacation Booking - ABL (1) Call Coordinator. Workflow Service Business Client (17) Return Fail (2) Call (4) Return (5) Call (8) Call (10) Return (16) Return (11) Call (14) Call Fail (13) Return Compensation Business Components Data Access Hotel Booking Business Components Flight Booking Data Access (3) Change DB (7) Return Car Booking (6) Change DB (15) Apply (12) Apply Compensation SOA-33: Transactions in a SOA World (9) Fails

Vacation Booking - ESB (1) Call Coordinator Service Bus Enterprise Service Client (17) Return

Vacation Booking - ESB (1) Call Coordinator Service Bus Enterprise Service Client (17) Return Fail (2) Call (4) Return (5) Call (14) Call (8) Call (10) Return (16) Return (11) Call (13) Return Fail Compensation Service 3 Service 2 Service 1 (3) Change DB (7) Return (6) Change DB (15) Apply (12) Apply Compensation SOA-33: Transactions in a SOA World (9) Fails

Vacation Booking - BPEL (1) Call Coordinator Service Bus Enterprise Service Client BPEL Service

Vacation Booking - BPEL (1) Call Coordinator Service Bus Enterprise Service Client BPEL Service (17) Return Fail (2) Call (4) Return (5) Call (14) Call (8) Call (10) Return (16) Return (11) Call (13) Return Fail Compensation Service 3 Service 2 Service 1 (3) Change DB (7) Return (6) Change DB (15) Apply (12) Apply Compensation SOA-33: Transactions in a SOA World (9) Fails

In Summary § ACID is good, taken in short doses! § Plan, Design &

In Summary § ACID is good, taken in short doses! § Plan, Design & Architect for target implementation § Choose the appropriate transaction model for you § Consider ESB & BPEL SOA-33: Transactions in a SOA World

? Questions SOA-33: Transactions in a SOA World

? Questions SOA-33: Transactions in a SOA World

Thank You SOA-33: Transactions in a SOA World

Thank You SOA-33: Transactions in a SOA World

SOA-33: Transactions in a SOA World

SOA-33: Transactions in a SOA World