How quickly is the history written?

Hello,

in Camunda, there are two DB table groups: one for the running instances on the other for the history.

Assume a process instance runs to an end (executes its last activity) in a SpringBoot based application (embedded engine) with the history level set to FULL.

How would you answer the following questions?

  1. How long does it take for the instance to NOT be found by the runtimeService query? I.e. by runtimeService.createProcessInstanceQuery().processInstanceId(...).singleResult()?

  2. How long does it take after the process completion that its status is reflected in the history? I.e. historyService.createHistoricProcessInstanceQuery().processInstanceId(...).singleResult().getState() == "COMPLETED" (or ...getEndTime() != null)?

Thank you!

Hello @fml2.

In the normal configuration with the default history implementation, the history is written in the same transaction as the runtime data.
So once the process instance completes and the corresponding transaction is committed, the data won’t be available in the runtime tables anymore and also directly in the history tables.
Actually there’ll also be data in the history tables beforehand, as each commit of a transaction will also populate history data about the already executed activity executions.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.