cancel
Showing results for 
Search instead for 
Did you mean: 

Distributed Architecture

kenjackson
Champ in-the-making
Champ in-the-making
Hi,

My company is currently investigating the suitability of Activiti for our workflow engine. We will require it to work in a high-availability environment, so we'll need a cluster of machine running the Activiti Engine. We will write our own REST interface which the client will call. This will then connect to the Activiti Engine.

Our proposed architecture is as follows:

- Database: An Oracle cluster which the Activiti Engine will connect to
- Server: Multiple servers each with their own instance of the Activiti engine running. These servers will also run our own custom REST interface, which will connect to the local Activiti Engine.
- Client: The client will call our own custom REST interface.

I have a few questions regarding this:

1) Will we be able to use an embedded Activiti Engine in our custom REST interface, or will we have to connect to the Activiti REST interface?
2) Will there be any risk of conflicts when using multiple Activiti Engines. i.e. two engines trying to claim a task at the same time?
3) Do we need to maintain a session to a particular instance of the Activiti Engine for session/state persistance, or is that all held in the database?

Thanks in advance,
Ken
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
1) Will we be able to use an embedded Activiti Engine in our custom REST interface, or will we have to connect to the Activiti REST interface?

The best approach is to use Activiti embedded. No need to 'proxy' to the Activiti rest api.

2) Will there be any risk of conflicts when using multiple Activiti Engines. i.e. two engines trying to claim a task at the same time?

No. Activiti has been designed for running in a clustered environment.
The only thing you need to take in account in your implementation is that you will need to cope with ActivitiOptimisticLockingExceptions. Ie. when two users will try to complete the same task, one of them will get this exception.


3) Do we need to maintain a session to a particular instance of the Activiti Engine for session/state persistance, or is that all held in the database?

No. The Activiti API is stateless. State is in the database.