Ondra Chaloupka / ochaloup@redhat.com
Note
|
|
-
earlier Arjuna, renamed to Narayana
-
JTA implementation in JBoss/WildFly
-
JTS distributed transaction over IIOP
-
webservice transactions (WS-AT/WS-BA)
-
STM for Vert.x
-
saga transactions over REST
-
What is meant under term microservice in scope of this presentation
-
How the the distributed transactions and 2PC works
-
What is saga and why could be good fit for microservice architecture
-
What are and how to use Narayana Long Running Actions
(credit: Christian Posta, http://blog.christianposta.com)
Note
|
|
-
An atomic unit of the work where everything or nothing is finished
-
usually in regards of data manipulation
-
-
Protecting shared resources from multiple users
-
A notion of a global consensus
-
ACID properties guaranteed
-
A�tomicity
-
C�onsistency
-
I�solation
-
D�urability
Note
|
|
-
distributed transaction runs over multiple services
-
XA transaction joins operations over multiple resources
Note
|
|
-
closely coupled environment
-
harder to scale
-
tight data coupling
-
-
short duration
-
locking reduces parallelism
-
-
Transactional model for long living transaction
-
Saga paper (H. Garcia-Molina, K. Salem; 1987)
-
Relaxing ACID properties
-
Eventual consistent
-
Web services: WS-BA specification, SOA design pattern
-
REST and event sourcing: microservices
Note
|
Original paper talks about Saga as a solution for long-lived database transactions. We can use it for distributed environment too for not using two phase commit (a.k.a. locks). Other names:
|
Note
|
The concept of the original paper talks about single node database but it could be applied to distributed transactions (as was already shown). Saga could be classified as As you could see the transaction handling introduced by Saga requires the application to define compensation actions or define actions as idempotent (you can repeat operation on the resource multiple times and you will get the same result - operation being repeated not leading to a different outcome). Still you can handle all the data integrity yourself in your application and design your system architecture to handle with failures. It’s up to you if concept of Saga is useful for you or not.
|
-
XTS: WS-BA (Web Services Business Activity)
-
Compensating transactions (CDI annotations)
-
LRA (Long Running Actions, over REST)
Note
|
|
-
LRA: Long Running Actions
-
Saga implementation for REST calls
-
based on the Eclipse MicroProfile stack (JAX-RS, CDI)
Note
|
To get logs for the particular services:
|
-
Narayana LRA - implementation of Saga for REST calls
-
a better fit for MSA than ACID transactions
-
a tool that can help in desiging the application
-
MSA principles should be preserved
-