cancel
Showing results for 
Search instead for 
Did you mean: 

Do we need to deploy processes per tenant for multi-tenancy to work?

asanjum
Champ in-the-making
Champ in-the-making
I have starting looking into Activiti's (version 5.17) multi-tenancy support and have some rookie questions. [disclaimer: I did searched the forums before posting but apologize if this is a repeat topic!]

Requirements: 
a. We will use Activiti's built-in multi-tenancy support using tenant_id field
b. We want to support thousands of tenants.
c. There could be dozens of processes
d. New tenants are being added all the time
e. Processes may get revised and therefore need to be redeployed

Given the above situation, I have a few doubts for the experts to clarify.

Q1. It appears that each process needs to be deployed per tenant in order to launch process instances for a given tenant Id. Is this correct?

Q2. If not, how do you achieve the sharing of processes? This would be a huge life saver.

Q3. If yes to Q1, isn't it cumbersome and inefficient to deploy same process to thousands of tenants whereas it could be shared?

Q4. If yes to Q1, is there some sample code anywhere that demonstrates best practice on how to deploy processes each time a new tenant gets provisioned or deploy to all tenants if a process gets updated?

Q5. Are there any ideas on what direction one may adopt to have shared process definitions that can be used to instantiate processes for a given tenant ID?


Thanks & regards,
sayeed
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
1) Correct. Process definitions are unique per tenant.

2) Sorry, not possible. Process definitions are tenant-specific.

3) No, the engine doesn't really care. It's just data in the database. The only thing that might need tweaking is the Process definition cache size.

4) No, that's custom code. Typically, tenants do not share process definitions .. or at least that's not how it is implemented currently.

5) That would need a serious amount of new code, cause once you start with tenancy, it is applied everywhere. Im thinking there might be workarounds with a custom Process Definition Cache … but I'm not sure of the implications that would have.

asanjum
Champ in-the-making
Champ in-the-making
Hi Joram,

A big thank you for the super fast reply.  This is what make the core Activiti team and the product winners.

This really gives us a lot of clarity and we can move ahead faster with a lot more conviction.

We have attempted to subclass the DeploymentCache, etc. but there are a lot of calls that are directly done via the CommandExecutor.  Not worth the risk for a multi-tenant app. You are the best guys to ponder over how to address this in a clean way. 

If you think this kind of requirement (shared process definitions) makes sense, I can post a Jira bug request for future development.

Once again, thanks a ton.

Regards,
sayeed

jbarrez
Star Contributor
Star Contributor
It does makes sense to me. It would be a nice addition. Please file a jira issue.