Skip to content

Database Architecture

The data layer of Champa Intelligence is designed for high performance and minimal impact on the source Camunda system. It achieves this through a direct-read approach using highly optimized SQL queries and a clear separation of concerns between the Camunda database and its own system database.


Direct Database Integration

Instead of relying on the often-limited Camunda REST API for analytics, Champa Intelligence connects directly to a read-only replica of the Camunda PostgreSQL database.

High-Performance SQL Queries

  • The core of the platform is a library of over 80 hand-crafted, highly optimized SQL queries.
  • These queries are specifically engineered to perform complex aggregations, historical analysis, and pattern detection directly within the database, which is far more efficient than fetching raw data and processing it in the application layer.
  • This data-first approach allows the platform to analyze millions of historical records and provide insights at a scale and speed unattainable through the standard API.

Connection Pooling

To manage database resources efficiently under heavy analytical loads, the application uses a psycopg2 connection pool. This maintains a set of ready-to-use database connections, eliminating the overhead of establishing a new connection for every query.


Database Separation

Champa Intelligence maintains a strict separation between the customer's Camunda data and its own application data.

1. Camunda Database (Read-Only)

  • The platform interacts with the standard Camunda act_* history and runtime tables.
  • Crucially, it only requires read-only access. This ensures that the Champa Intelligence platform can never modify, corrupt, or interfere with the operation of the Camunda engine.

2. System Database (Read/Write)

  • A separate, dedicated PostgreSQL database is used to store all of Champa Intelligence's own data.
  • This includes a dedicated auth schema for:
    • users: User accounts, credentials, and profile information.
    • roles and permissions: The Role-Based Access Control (RBAC) model.
    • sessions: User session data (as a persistent fallback to Redis).
    • audit_log: A comprehensive audit trail of all user actions.

This separation ensures that the Champa Intelligence application is self-contained and does not pollute or alter the core Camunda schema in any way.