cancel
Showing results for 
Search instead for 
Did you mean: 

Architecture while using Activiti Datasource

frankee787
Champ on-the-rise
Champ on-the-rise
Dear All,
  I am trying to convince myself on the architecture of introducing the Activiti Datasource/Database(ADS). When I say ADS, I mean the database where Acitivi store the process states and other process metadata.
  To be more precise lets take an example. Lets say I have a Loan System as part of a banking module. The Database which store the application will be the Loan System Database(LDS).
   Now, should LDS and ADS be in the same database ?

eg: If I were using Oracle Database should LDS and ADS exist in the same schema?
eg: If I were using MySQL Database should LDS and ADS exist in the same database?


My gut feeling says they should be in two different schemas/databases. However, this obviously introduces XA transactions. JTA with XA transaction is a beast by itself and hence makes me choose a single schema/database

This is my dilemma. Could you please share you insights on how you would go about using Acitivi?

Thanks and Regards,
Franklin
6 REPLIES 6

frederikherema1
Star Contributor
Star Contributor
All depends on your own preference (and whether or not you should pass by a DBA Smiley Wink), but I don't see a problem in using the same datasource/schema. If you can look at activiti as a "part" of your system, there is really no reason why it shouldn't be there… (the tables are prefixed as well)

mahavirj
Champ in-the-making
Champ in-the-making
having the activiti tables in a different schema but the same db would not require xa transactions

frankee787
Champ on-the-rise
Champ on-the-rise
having the activiti tables in a different schema but the same db would not require xa transactions

That would mean …you are referring to Oracle Database. And you are correct. When Acitiviti is in a different schema but same database you WOULD NOT need XA transaction. I believe you could work around the problem with synonyms/grants. Please correct me if I am wrong.

But again that is the speciality of Oracle DB and you are coupled up with it.

Regards,
Franklin

heymjo
Champ on-the-rise
Champ on-the-rise
Is the transaction not handled on the level of the datasource rather than the underlying resource ? So even if you have 2 datasources pointing to the same database you will still need XA to have atomic use case execution, that's how i thought it worked.

Jorg

PS xa/jta is not a beast anymore, Spring has tamed it quite well Smiley Wink

frankee787
Champ on-the-rise
Champ on-the-rise
Having two datasources will definitely leave you with no room but to use XA/JTA transactions.

Sure Spring has done a good deal of job to tame XA, nevertheless XA/JTA transactions  are still complex and you will see a LOT of problem is production when you have long running processes(I guess)

So do you agree with Single Datasource of Two Datasource(One for the application and One for Activiti ) ?

heymjo
Champ on-the-rise
Champ on-the-rise
going for the best practice approach and if it were my call I would

- keep the activiti tables separate from the application tables. Keeps the dba happy, some of them like SOC as much as we do ! Also allows to easily upgrade application schema separate from workflow and vice versa.
- use xa, so 2 datasources. This way you're prepared in case you need to access other transactional resources from your use case (e.g. message queues).