# Multi engine / shared database

**URL:** <https://forum.flowable.org/t/multi-engine-shared-database/3405>\
**Category:** Flowable Engine\
**Created:** [February 8, 2019, 8:56am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405 "2019-02-08T08:56:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![awolfard](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/awolfard/32/1088_2.png) [@awolfard](https://forum.flowable.org/u/awolfard)\
**Post date:** [February 8, 2019, 8:56am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/1 "2019-02-08T08:56:45Z")

</div>

Hi,

I am investigating Flowable at the moment and was wondering if this scenario is supported:

We want to deploy multiple applications with each application having it’s own engine and processes which are stored in 1 database.

We want each application/engine to have it’s own asynch executor (job scheduler) running.

Could we use the tenant functionality to support this scenario? Can we configure the async task executor in such a way that only jobs of a specific tenant (which is in my case a flowable engine) are selected and jobs of other tenants (which should be picked up by another engine) are ignored?

With kind regards,

Arnoud.

---

<div class="post-metadata">

**Author:** ![donkon](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@donkon](https://forum.flowable.org/u/donkon)\
**Post date:** [March 10, 2019, 1:39pm UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/2 "2019-03-10T13:39:39Z")

</div>

That would be interesting for me too. It would be a nice feature for doing canary deployments, e.g. in Kubernetes, so that the Job Executor of the canary instance (Pod) is aware of a specific bpmn deployment - for making sure, that after going live, my changed bpmn is working well together with my changed application code

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [March 12, 2019, 8:01am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/3 "2019-03-12T08:01:06Z")

</div>

Hi Arnoud,

> [@awolfard](#):
>
> We want to deploy multiple applications with each application having it’s own engine and processes which are stored in 1 database.

The feature is supported ([multitenancy deloyments](https://blog.flowable.org/2018/09/11/multitenancy-in-flowable/))

> [@awolfard](#):
>
> We want each application/engine to have it’s own asynch executor (job scheduler) running.

Each engine can have its own executor.

> [@awolfard](#):
>
> Can we configure the async task executor in such a way that only jobs of a specific tenant (which is in my case a flowable engine) are selected

Try [ExecutorPerTenantAsyncExecutor](https://github.com/flowable/flowable-engine/blob/eeebfd23af3571741b60e3f663f17c0ecc50a812/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/asyncexecutor/multitenant/ExecutorPerTenantAsyncExecutor.java)

Regards  
Martin

---

<div class="post-metadata">

**Author:** ![duwei54](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/duwei54/32/1625_2.png) [@duwei54](https://forum.flowable.org/u/duwei54)\
**Post date:** [February 11, 2020, 5:35am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/4 "2020-02-11T05:35:23Z")

</div>

Hello, I’m a novice. I want to know if I can set the global tenantId at this `Multi engine / shared database` scene.I use the `flowable-spring-boot-starter-process-rest`.So I don’t have to pass tenantId param in each api calls.  
thank you very much! 😀

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [February 11, 2020, 8:38am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/5 "2020-02-11T08:38:57Z")

</div>

Hi,

Do you need global tenant id for process instance start? (to look for process definitions in the global scope…)  
Regards  
Martin

---

<div class="post-metadata">

**Author:** ![duwei54](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/duwei54/32/1625_2.png) [@duwei54](https://forum.flowable.org/u/duwei54)\
**Post date:** [February 12, 2020, 3:54am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/6 "2020-02-12T03:54:27Z")

</div>

Thanks for you reply. I have two services build with `flowable-spring-boot-starter-process-rest`,and each service has its own processEngine but share the same database.so I want use `tenantId` to achieve Multitenancy.  
When I call serviceA rest API,I must pass the `tenantId` param of serviceA.So,Is there any way to config a init tenantId for processEngine of serviceA?  
Best wishes! 😄

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [February 12, 2020, 6:35am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/7 "2020-02-12T06:35:12Z")

</div>

Hi,  
The short answer is no. Both engines can handle requests for both tenants. If you put load balancer in the front of rest service you can split requests, but it is outside of flowable-engine.  
Martin

---

<div class="post-metadata">

**Author:** ![duwei54](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/duwei54/32/1625_2.png) [@duwei54](https://forum.flowable.org/u/duwei54)\
**Post date:** [February 13, 2020, 4:08am UTC](https://forum.flowable.org/t/multi-engine-shared-database/3405/8 "2020-02-13T04:08:45Z")

</div>

OK,I understand.Thank you for your patience.  
Best Regards
