General implemented pattern for cache vs DB lookups for Process Engine Services?

What is the general ‘rule of thumb’ in the engine for cached queries vs actual db look ups, for process engine services.

Example i am looking at: Deployment information about a process def id: if you were doing a execution.getProcessEngineServics().getRepositoryService()… and you were looking up the deployment details about a specific process definition ID. Would this type of request typically be using cached information and not actually be performing DB lookup? What sort of mental model should be followed?

i am aware of: Deployment Cache | docs.camunda.org

It’s roughly like this:

  • Exceptions may apply.
  • Note that range query includes all createXQuery service methods, even if they query a single entity by whichever filter.
2 Likes

@thorben thanks for this!! Very helpful!

@thorben your “rule”/flow is not applicable for Process Definition Queries, given: https://docs.camunda.org/manual/7.9/user-guide/process-engine/deployment-cache/ ?

Should apply the same for the deployment cache. All it adds on top is that it caches the in-memory process definition object tree across commands, so we don’t have to parse the XML everytime. But it still hits the database once to check if the process definition is still there.

Thank you. Very helpful