> ## Documentation Index
> Fetch the complete documentation index at: https://aletyx.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Engine Architecture

> How the Apache KIE process engine works - the Kogito state machine powering jBPM (BPMN) and SonataFlow, with pluggable persistence (PostgreSQL, MongoDB, Infinispan, RocksDB).

[<img src="https://mintcdn.com/aletyx-3353d50c/UdT8DI1QFCgugDzY/images/architecture/core/processes/images/state-machine.png?fit=max&auto=format&n=UdT8DI1QFCgugDzY&q=85&s=38a594197af0e99c19c27b2a87291df8" alt="The Engine" width="591" height="328" data-path="images/architecture/core/processes/images/state-machine.png" />](/docs/images/architecture/core/processes/images/state-machine.png)

At the core of any workflow system lies the **engine**, a state machine responsible for processing inputs and moving processes between states until they reach a waiting state or completion.

In Apache KIE, the engine is provided by **Kogito**, which powers both **jBPM** and **SonataFlow**. These two frameworks offer different capabilities but share the same engine. In simplified terms, **jBPM** and **SonataFlow** expose the engine through their respective **domain-specific languages (DSLs)**—**BPMN** and **CNCF Serverless Workflow**, respectively.

### Pluggable and Efficient Persistence

One of the key strengths of Apache KIE is its **pluggable persistence mechanism**, allowing seamless switching between different storage solutions such as **PostgreSQL, RocksDB, Infinispan, MongoDB, or FileSystem**. Among these, **PostgreSQL** is the most mature and widely adopted.

The engine employs a **de-normalized persistence model**, storing only essential data as **key/value pairs** to maintain efficiency. This is a deliberate design choice, addressing performance bottlenecks faced in previous generations of the engine, where a fully normalized data structure hindered scalability in high-volume environments. By separating **runtime data from queryable data**, the system ensures optimal performance even under intensive workloads.

[<img src="https://mintcdn.com/aletyx-3353d50c/UdT8DI1QFCgugDzY/images/architecture/core/processes/images/engine-data-model.png?fit=max&auto=format&n=UdT8DI1QFCgugDzY&q=85&s=c30fa538825dd34cc0f0949afafe165a" alt="Database Entities" width="691" height="194" data-path="images/architecture/core/processes/images/engine-data-model.png" />](/docs/images/architecture/core/processes/images/engine-data-model.png)
