cancel
Showing results for 
Search instead for 
Did you mean: 

Shared DB Multitenancy

hari
Star Contributor
Star Contributor
Hi,

We would like to implement shared db multi-tenancy and would need some inputs from you to proceed on this. We have already delivered some part of the application to our client and he wants to implement the same for the entire group of companies that they own. Below are some of my questions that I have now.

1) While deploying/uploading a bpm via activiti-explorer it never asked me for which tenant I am uploading it. How to configure this ?
2) Can I upload/deploy the bpm once and use for all tenants as some of them are same across tenants ?
3) While fetching the tasks assigned to a user, I fetch them as below
    MyProcessEngine.getInstance().getTaskService().createTaskQuery().taskAssignee(userName).list()
Now how can I fetch them based on the tenant here ?

8 REPLIES 8

jbarrez
Star Contributor
Star Contributor
1) The engine is multi tenant enabled out of the box, but Explorer is not (that would be manual coding, as we don't have plans to add that)

2) No, if you use the multi tenant engine option, the process would need to be duplicated for each tenant. It's a nice feature though … but we don't have it yet where you can have a process for all tenants

3) Add taskTenantId() option

hari
Star Contributor
Star Contributor
Thanks for your reply Barrez. Appreciate your help.
I have one more query. We already have deployed 5 BPM's for the client. Now my question is how should I associate them to a tenant ?

jbarrez
Star Contributor
Star Contributor
That's going to be hard - that would mean you manually would have to set the tenant id on the different tables.
You'd also need to update your logic, the API calls should become 'tenant-aware'

hari
Star Contributor
Star Contributor
After reading your blog on multi-tenancy and the complexities involved with this(shared db multi tenancy) approach in our present scenario, I am thinking of multi-engine multi-schema multi tenancy for now as we have very limited time to deliver. But I believe with this approach we should be able to implement single engine multi schema multi-tenancy in future.  What are your thoughts ?

jbarrez
Star Contributor
Star Contributor
Yes, indeed, that's a correct assumption, but I don't know if someone has actually tested it out before.
But in theory, yes, you are correct.

hari
Star Contributor
Star Contributor
I am just wondering how can I do the multi schema, multi engine, multi tenancy using activiti-rest  ?
Do I need to build my wrapper and expose my own REST services or does activiti-rest support this out of the box ?

jbarrez
Star Contributor
Star Contributor
yeah, you'd have to proxy that yourself and do the switching yourself.
Activiti-rest doesn't have anything there that could do this.

ak1801
Champ in-the-making
Champ in-the-making
Hi jbarrez,

Referring to your blog - http://www.jorambarrez.be/blog/2015/10/06/multi-tenancy-separate-database-schemas-in-activiti/
I want to implement multi-engine multi tenancy in my application. Is there any way, I can configure it directly or do I have to implement myself?

Thanks in advance.