Engineering Kruise: One Intelligent System for Enterprise Operations
How the KEEHOO Engineering team architects Kruise and Kee2 to unify
operational transactions, workflows, and real-time intelligence.
By the KEEHOO Engineering Team | Building Kruise
and Kee2
1. Operational reliability first
Kruise runs on a multi-tenant operational core backed by PostgreSQL, handling orders,
inventory movements, procurement, production, finance, HR, and help desk workflows.
Our core engineering rule is simple: transactional APIs and operational
screens must stay fast and predictable, even as analytical workloads
grow.
2. Flow-driven customization without fragmentation
Every enterprise operates differently. Kruise's Flow Builder lets teams adapt
approvals, routing, and business rules to their exact processes without maintaining
separate codebases per customer.
3. Kee2 & embedded workflow agents
On top of unified operational data, Kee2 provides a plain-language Conversation
Engine while embedded AI agents continuously watch for delays, surface root causes,
and draft next actions with human approval.
Tech Articles · Data Analytics
The $1,200 Compute Lesson
Read how we revisited our Databricks Medallion Architecture, SQL Warehouses, and
compute governance to balance real-time analytics with cloud economics.
Tech Articles · Data Analytics
Data Analytics
Engineering notes on real-time enterprise intelligence,
Databricks architecture, and cloud compute governance.
Kruise · Engineering Insights · 27 November 2026
The $1,200 Compute Lesson: From SQL Warehouse Serving to Cost-Conscious Analytics
How Kruise revisited its initial BI and conversational analytics design, and adopted a workload-driven strategy for precomputation, efficient data serving, and governed interactive SQL.
Article by Sanket · By the Kruise Engineering Team
Article Author
SanketGen AI and Data Specialist
Enterprise intelligence without burdening the operational platform
Kruise is an AI-native enterprise platform covering sales, inventory, procurement, production, finance, and related operations. Its conversational analytics experience, Kee2, lets business users ask questions about shortages, sales, suppliers, and business performance in natural language and receive data-backed answers and visualizations.
Our original architectural mandate was sound: keep the PostgreSQL transaction layer responsive and move heavy historical joins, broad aggregations, and exploratory analytics to a dedicated analytical environment. We wanted powerful insight without slowing order-entry, inventory, or other customer-facing APIs.
Figure 1. Kee2 conversational analytics: an example of low-stock inquiry, tabular results, and a generated chart.
Our initial design: SQL Warehouse as the analytics serving layer
That separation led us to Databricks. Kruise captured business events and ingested them using Zerobus. Data flowed through Bronze → Silver → Gold: raw events, cleaned business records, and curated fact/dimension tables.
In the initial architecture, we built SQL views over Gold data and used Databricks SQL Warehouse to execute queries for BI dashboards. The Kruise UI consumed these dashboards, while the Kee2 conversational agent could query the SQL Warehouse for analytics. This provided a flexible analytical path, including queries spanning more than one business domain.
Figure 2. Kruise event-driven lakehouse architecture (initial design). Analytics were served using Databricks SQL Warehouse, which executed SQL views on Gold data for dashboards and conversational queries.
The cost checkpoint: approximately $1,200
While examining a workload involving approximately 10,000 records, we observed a $1,200 Databricks-related compute bill. This is our internal compute experience, not a per-record Databricks rate. Billable usage depends on the configured compute, elapsed running time, query patterns, concurrency, and related workloads.
The platform answered the questions. The issue was whether an interactive analytical engine should be used repeatedly as the ordinary serving path for every dashboard and conversational request. Our internal review documented approximately 80% of Databricks compute attributed to SQL Warehouse serving activity, with less than 1% attributed to Bronze–Silver–Gold pipeline activity in that period; these figures reflect our own analysis and have not been independently audited.
The review also described an example where roughly nine minutes of query execution corresponded to four to five hours of active warehouse time, because intermittent dashboard and API requests continued to arrive before compute stopped. The lesson was less about row count than about how often query execution was requested, and how long the compute resource remained active.
“Fast queries are not necessarily inexpensive queries when the serving infrastructure remains active between them.”
The realization: when should we query live, and when should we precompute?
We revisited the design through three questions: Is the question predictable? How often does the underlying data change versus how often users read it? How fresh must the answer be?
Figure 3. Compute-path decision guide: scheduled Gold KPI precomputation for predictable metrics, governed SQL Warehouse for open-ended analysis. The comparative cost depends on workload and deployment.
Where scheduled Spark compute and Gold KPI tables are a good fit
Daily sales, low-stock indicators, supplier performance, regional sales drill-downs, and other repeatedly requested measures usually have known definitions and bounded dimensions. Incremental Spark/PySpark jobs can maintain physical Gold KPI tables on a defined freshness schedule, with only affected records or periods updated. A small indexed PostgreSQL serving database can then answer frequent UI/Kee2 requests without opening a SQL Warehouse on each page load.
Where SQL Warehouse earns its place
SQL Warehouse remains valuable for unpredictable analysis, flexible multi-domain SQL, interactive investigation, analyst workflows, and new Kee2 questions not covered by predefined KPI summaries. Such queries may combine sales, inventory and procurement facts. Fact tables should be joined at compatible grains to prevent fan-out and incorrect totals; pre-aggregate when appropriate. Query-time compute is justified when the requirement genuinely demands exploration.
Our revised architecture: heavy lifting on schedule, lightweight serving by default
We consequently separated analytics preparation from everyday consumption. Operational indicators remain close to PostgreSQL where they can be obtained through bounded queries or lightweight maintained summaries. Historical and cross-module KPI preparation uses scheduled, incremental Databricks processing. Changed Gold KPI rows are published to a PostgreSQL/Neon serving layer for repeatable access by Kruise dashboards, reports, alerts and Kee2. SQL Warehouse remains available for governed, on-demand investigation.
Figure 4. Kruise target cost-optimized design: event capture, scheduled incremental Bronze/Silver/Gold processing, change-only export to Neon/PostgreSQL, and on-demand ad-hoc SQL. The $0.37/DBU label visible in the diagram is an internal illustrative estimate, not a published universal rate.
Example: new invoices should change only the affected KPI groups
A new ₹10,000 Bolt A invoice in Hubballi can update the appropriate product, town, district, state and country sales totals. It need not trigger a fresh scan of all historical invoice lines every time a user drills down. Corrections, backdated transactions, and hierarchy changes still require explicit reconciliation logic or bounded backfills.
KPI type
Persisted information
Efficient update method
Sales revenue / order count
Additive sums and counters
Increment relevant product/location/day groups
Average value / conversion
Numerator and denominator
Update components; divide at read time
Stock balance
Current balance and movement ledger
Apply movements and reversals safely
Distinct customers
Exact identifiers or mergeable sketches
Deduplicate or merge according to accuracy needs
Ageing / overdue
Open item and due-date information
Rebucket affected items as time passes
If SQL Warehouse is required, optimize its economics
The correct objective is not to forbid SQL Warehouse or serverless compute. It is to choose the most economical eligible configuration while meeting user expectations for freshness, concurrency, and latency.
Control
Engineering action
Compute size and scaling
Begin with a measured capacity baseline; provision only what latency and concurrency require.
Auto-stop and idle gaps
Keep idle runtime short where practical; benchmark the trade-off against restart latency.
Application query patterns
Prevent uncontrolled page-load polling and repeated analytics API calls; cache or serve stored results.
Materialized views
Use for eligible reusable SQL results; monitor refresh cost and whether refresh is incremental.
Incremental refresh policies
Validate eligibility and apply strict incremental policies where supported; account for initial loads and backfills.
Query plans and billing
Inspect scanned data, joins, query history, runtime, and workload attribution before changing compute.
Access and budgets
Govern who can invoke exploratory queries; apply limits, approval gates, budget alerts, and tenant attribution.
Customer needs should determine analytical freshness and cost
Kruise now evaluates analytical features according to business urgency, query complexity, and expected read frequency. Current operational alerts may require seconds; management dashboards may tolerate minutes or hours; historical restatement and forecasting may run on demand. The aim is to make material compute requirements and potential charges transparent before resource-intensive work is activated.
For our platform, precomputation often reduces repeated analytical query cost, especially when a metric is read far more frequently than its source data changes. It is not a universal guarantee: a full refresh can sometimes be cheaper than incremental maintenance, and a right-sized SQL Warehouse can be efficient for interactive workloads. We benchmark the whole system, including scheduled jobs, storage, synchronization, serving, and user latency.
Evidence / Compute Economics: What changed in our daily usage?
The account usage history shows elevated daily spend during portions of November and a marked reduction later in the month, following our engineering review and changes to how routine KPI consumption is served.
Figure 5. Databricks account usage view, captured 27 November 2026. The visible tooltip shows an estimated $0.03 (0 DBU rounded) on 25 November; earlier dates show substantially higher daily usage.
How to interpret this evidence
This usage view supports a substantial reduction in daily account usage during the displayed period. It does not, on its own, establish a like-for-like monthly dollar saving against the earlier $1,200 bill. A verified percentage reduction would require comparable billing windows, workloads, and included cost categories.
Our operating decision remains: serve repetitive KPI reads through prepared aggregates and a lightweight API, while retaining governed SQL Warehouse access for complex or exploratory analytical questions.
Engineering for Scale. Governing for Cost.
The $1,200 expenditure sharpened an important distinction: delivering an analytical answer is one challenge; delivering it repeatedly at sustainable SaaS economics is another. Our refined approach keeps PostgreSQL focused on operations, Databricks focused on analytical processing, precomputed Gold KPIs available for high-frequency reads, and SQL Warehouse accessible when the question requires it.
“Compute only what is necessary. Recompute only what changed when practical. Serve prepared results repeatedly. Preserve exploratory compute for questions that justify it.”
Publication notes and disclaimers
Independent engineering account. This article describes Kruise’s own implementation choices and internal review. It is not an official Databricks publication, benchmark, certification, pricing guarantee or endorsement. References to third-party products are factual; associated marks belong to their owners.
Cost and evidence. The approximate $1,200 expenditure and ~10,000-record workload are specific to the internal period under review and do not describe per-record pricing. The ~80% SQL Warehouse and under-1% pipeline attribution, and the query-versus-active-time example, come from the supplied internal technical write-up and are not independently audited. No post-optimization dollar amount is asserted.
Architecture and feature applicability. Depicted design and decision logic should be interpreted in the context of Kruise’s workloads. Cloud fees, DBU rates, SQL Warehouse behavior, incremental-refresh eligibility, serverless options and feature availability depend on configuration and may change.