Hello everyone,
I am facing a problem with querying for a processes/tasks that are identified by some variable value.
As the variables are being held in separated table and the system that I’m developing will hold, probably, a few million opened process all the time - I think that using this API will be inefficient enough to use it in a business case.
Therefore my question: are there any recommended ways to achieve such identification? If possible I would like to stay with the mechanism based on existing schema/AP
1 Like
Hi,
Can you use the value of your variable as the business key? If so, queries based on business key can be quite efficient. Of course business key must be stable for the duration of the process…
regards
Rob
As you said the business key must be stable for the duration of the process. As far as I know it also must be unique (tell me if I’m wrong).
Cheers.
Hi,
it doesn’t have to be unique, but its most useful usecases are when it is intrinsically unique. If your variable is not unique, perhaps a composite is - eg if your variable was say the start date of the process instance, then perhaps customer_id + start_date forms a unique composite business key?
regards
Rob
Are you trying to perform some sort of correlation here? If your process count is what you say it is, good luck with all of that. I cannot imagine that you can keep “millions” of processes open (and presumably sleeping) without a back end database of staggering performance.
We tried to use the message correlation function in Camunda and had to abandon it once we discovered it was row scanning tables. We’re going to have to build an external correlation database for this that we can heavily index and optimize and that is not, we hope, restricted to a READ COMMITTED isolation level (though we may not have a choice).
I think that external database is the only solution in this case. I’m describing the situation here: ACT_RU_TASK.PARENT_TASK_ID_ missing index?
That’s what we’re going to do. It’s particularly helpful when you have multiple, separate instances of Camunda. That said, keep an eye out for this next generation “BPMN in the cloud” think Camunda is working on.