cancel
Showing results for 
Search instead for 
Did you mean: 

what is the best architecture?

tbee
Champ in-the-making
Champ in-the-making
I'm considering using Activiti in one of my projects, but I'm a bit uncertain about the best architecture. Activiti basically is an active component. This means that when the environment triggers a "compete task", the workflow will move forward to the next task in the workflow, and possibly execute whatever action is required for that task in the current environment. This means that any environment that modifies the workflow in principle must be able to execute any possible action.

Given that fact, one would lean towards making Activiti the center of the universe; it is the central core which initiates actions. If that is the case, then one would expect some kind of central "workflow" server, basically an application server. And naturally things like clustering / fail over / load balancing become issues.

But in the era of cloud computing, a more decentralized and distributed approach is often used. In this case I would imagine Activiti to be a component, for example embedded in a webapp. But that would mean all actions are executed on the webserver. You may not want certain actions to happen there. For example, somewhere in the workflow some documents need to be generated. You do not want the webserver to carry that load and offload it to separate batch server.

So what is wise?
1. Create a central Activiti workflow server including fail over / load balancing.
2. Embed Activiti in the components of system.

I'm leaning toward 2. But if you embed Activiti, are there any chances of conflicts because multiple workflow engines are active at the same time (each webserver has an engine, the batch processes have an engine, etc)?
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

It's really difficult to answer this question without all the context.
If you go for option 2 and run Activiti embedded there should be no issue with running multiple Activiti Engines.
The only component that you have take into consideration is the job executor. If the job executor is active on multiple Activiti Engines it will poll for the same jobs.
We implemented a locking strategy so that only one Engine is able to execute a job, so that's also fine.
You may get some exceptions because a job executor is accessing an already locked job, but that's on our todo list to change to a info message instead of the current log level.

Best regards,