Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Narayana 5:
The premier open source
transaction manager
JBug NCL: 12th May 2015
TOM JENKINSON
Agenda
● Why you need a transaction manager
● Using Narayana inside containers
● New features in Narayana 5
Why you need a transaction manager - a brief
revision course
My bank Your bank
Transactions - why?
My bank account Your bank
account
?
The properties of a transaction
There are many types of transaction models, they
generally revolve around adherence to and...
Transaction APIs
● Specifications:
○ JSR-907 JTA 1.2
○ OMG OTS 1.1
○ OASIS WS-AT 1.2
○ OASIS WS-BA 1.2
○ X/Open TM
○ rest-...
Transaction
Manager
(Narayana)
Resource Manager
(PostGres,
HornetQ, etc)
Application Programs (you)
XA
JTAJDBC JMS
X/Open ...
2PC protocol
XAResource xar1 = . . .
XAResource xar2 = . . .
TM.begin();
TM.enlist(xar1);
xar1.start(xid1);
TM.enlist(xar2...
Narayana proprietary APIs
● TxCore
● TXoJ
● Compensations Framework
● STM
● Utilities:
○ TransactionalDriver
○ Tooling to ...
Other terms
Transaction types:
● Global
● Distributed
● Local
Recovery:
● Bottom-up
● Top-down
Using Narayana inside containers
WildFly, Undertow, Docker, Tomcat
WildFly
Fully integrated into WFLY
● Provides JTA 1.2/JTS implementation
● Provides REST-AT coordinator
● Provides WS-AT/B...
Docker
Docker files for RTS and XTS:
https://github.com/Gytis/jboss-dockerfiles-
narayana/tree/master-xts-and-rts-images
D...
REST-AT and Undertow
Start up a REST-AT coordinator in 3 lines!
org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsSe...
JTA in Tomcat
We have two approaches for this
1. Tight integration into Tomcat structure
2. Running within the IronJacamar...
New features in Narayana 5
Compensations Framework, NoSQL, STM
Compensations Framework
Provides JTA 1.2. like API:
● @Compensatable
● @TxCompensate
● @TxConfirm
Works both locally and r...
NoSQL
In development
● Atomic
● Eventually consistent
● Relaxes isolation
● Durable
Updates to documents add in transactio...
STM
A concurrency model for editing shared state
Broadly speaking can be broken into:
● Optimistic Concurrency Control
● P...
Other things we are working on
We have a prototype of a data-grid transaction
log
We are coming up against CAP theorum for...
Questions? Links!
Our site: http://narayana.io
Our code: https://github.com/jbosstm/
Read our opinions: http://jbossts.blo...
Upcoming SlideShare
Loading in …5
×

Narayana 5: The premier open source transaction manager

3,783 views

Published on

In this JBug, Tom will use an example driven format to illustrate some of the new features that have been added into Narayana recently. We will look at:
1. Why you need a transaction manager - a brief revision course
2. Using Narayana inside none-EE containers, mainly focussing on Tomcat

Published in: Technology
  • Be the first to comment

Narayana 5: The premier open source transaction manager

  1. 1. Narayana 5: The premier open source transaction manager JBug NCL: 12th May 2015 TOM JENKINSON
  2. 2. Agenda ● Why you need a transaction manager ● Using Narayana inside containers ● New features in Narayana 5
  3. 3. Why you need a transaction manager - a brief revision course
  4. 4. My bank Your bank Transactions - why? My bank account Your bank account ?
  5. 5. The properties of a transaction There are many types of transaction models, they generally revolve around adherence to and relaxation of the so-called ACID properties: ● Atomicity ● Consistency ● Isolation ● Durability
  6. 6. Transaction APIs ● Specifications: ○ JSR-907 JTA 1.2 ○ OMG OTS 1.1 ○ OASIS WS-AT 1.2 ○ OASIS WS-BA 1.2 ○ X/Open TM ○ rest-* REST-AT 2.0 draft 8 ● Related: ○ XA ○ X/Open ATMI
  7. 7. Transaction Manager (Narayana) Resource Manager (PostGres, HornetQ, etc) Application Programs (you) XA JTAJDBC JMS X/Open DTP Recovery Manager Transaction Log
  8. 8. 2PC protocol XAResource xar1 = . . . XAResource xar2 = . . . TM.begin(); TM.enlist(xar1); xar1.start(xid1); TM.enlist(xar2); xar2.start(xid2); “xar1”.op(...); “xar2”.op(...); TM.delist(xar1); xar1.end(xid1); TM.delist(xar2); xar2.end(xid2); TM.commit(); xar1.prepare(xid1); xar2.prepare(xid2); xar1.commit(xid1); xar2.commit(xid2);
  9. 9. Narayana proprietary APIs ● TxCore ● TXoJ ● Compensations Framework ● STM ● Utilities: ○ TransactionalDriver ○ Tooling to query the transaction log
  10. 10. Other terms Transaction types: ● Global ● Distributed ● Local Recovery: ● Bottom-up ● Top-down
  11. 11. Using Narayana inside containers WildFly, Undertow, Docker, Tomcat
  12. 12. WildFly Fully integrated into WFLY ● Provides JTA 1.2/JTS implementation ● Provides REST-AT coordinator ● Provides WS-AT/BA coordinator ● Can be extended to provide an XATMI backend for C applications
  13. 13. Docker Docker files for RTS and XTS: https://github.com/Gytis/jboss-dockerfiles- narayana/tree/master-xts-and-rts-images Docker files for JTS: https://github.com/Gytis/narayana-docker https://github. com/Gytis/quickstart/tree/master-JBTM-
  14. 14. REST-AT and Undertow Start up a REST-AT coordinator in 3 lines! org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer server = new org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer(); server.deploy(new org.jboss.jbossts.star.service.TMApplication(), "/"); server.start(Undertow.builder().addHttpListener(8080, "localhost"));
  15. 15. JTA in Tomcat We have two approaches for this 1. Tight integration into Tomcat structure 2. Running within the IronJacamar embedded container https://github. com/jbosstm/quickstart/tree/master/jca-and- tomcat
  16. 16. New features in Narayana 5 Compensations Framework, NoSQL, STM
  17. 17. Compensations Framework Provides JTA 1.2. like API: ● @Compensatable ● @TxCompensate ● @TxConfirm Works both locally and remotely Currently does not support recovery http://jbossts.blogspot.co. uk/2013/05/compensating-transactions-when-
  18. 18. NoSQL In development ● Atomic ● Eventually consistent ● Relaxes isolation ● Durable Updates to documents add in transactional data
  19. 19. STM A concurrency model for editing shared state Broadly speaking can be broken into: ● Optimistic Concurrency Control ● Pessimistic Concurrency Control The difference is when locks are checked Typically you have relaxed durability
  20. 20. Other things we are working on We have a prototype of a data-grid transaction log We are coming up against CAP theorum for when to elect a recovery manager
  21. 21. Questions? Links! Our site: http://narayana.io Our code: https://github.com/jbosstm/ Read our opinions: http://jbossts.blogspot.co.uk/ Chat to us: http://webchat.freenode.net/?channels=jbossts Question us: https://developer.jboss.org/en/jbosstm/

×