Querying private credit portfolios with Databricks Real-Time
TL;DR
- We explored a private credit monitoring MVP combining direct queries to a governed Unity Catalog lakehouse table with in-memory snapshots in the backend.
- Comparing the previous serverless warehouse with a shared Databricks Real-Time (RT) warehouse, median query durations fell by 71.8% to 87.8% across the three measured profiles.
- In the backend SQL client logs, measured p95 latency fell by 3,864.55 ms (49.7%), from 7,770.16 ms to 3,905.61 ms.
- These measurements capture query execution and the instrumented backend client path — not browser page-load time or guaranteed performance under sustained concurrency.
A portfolio total cannot explain which receivables drive an overdue balance or concentrated exposure. That requires consistent views across portfolios, borrowers, and individual receivables.
At CERC, we explored this problem through a minimum viable product (MVP) for private credit monitoring. The client is a securitization company operating in that market. Testing new technologies and approaches to solve real problems for our clients, partners, and internal operations is part of our engineering culture — building on our earlier Lakehouse Real-Time exploration. This article covers the implementation and measurements, not a production-scale performance guarantee.
The implementation combines direct lakehouse queries with in-memory snapshots in the application backend. We compared the previous serverless warehouse with a shared Databricks Real-Time (RT) warehouse. Recorded query medians fell by 71.8% to 87.8%, depending on the query profile. The backend SQL client’s measured p95 fell by 3,864.55 ms (49.7%).
These are query measurements, not browser page-load times. Understanding that boundary is as important as the improvements themselves.
The data path
A React/Vite portal calls a NestJS backend running on Google Kubernetes Engine (GKE). The backend queries a governed analytical table through the Databricks SQL Statement Execution API. Unity Catalog governs table access; the backend authorizes users and filters their responses.
The arrows show requests and reads. Results return along the same path.
The analytical table contains portfolio and receivable identifiers, borrowers, dates, amounts, and payment status. For snapshot-backed aggregations, the backend performs two queries:
- Find the latest reference date available in the table.
- Load the receivables belonging to that date.
The observed snapshot contained approximately 29,354 rows. The backend reuses these rows for aggregations instead of repeating each grouping in SQL. Other endpoints may still run their own queries.
This exchanges repeated warehouse work for application memory and processing. Snapshot size and instance count therefore matter when sizing the backend. Direct access avoids a dedicated relational replica, but does not eliminate copies in memory. This benchmark compares warehouses, not Databricks against a relational database or Redis.
Cache lifetime and data freshness
The service cache uses organization-scoped keys, with a configured lifetime capped at midnight UTC. Manual refresh can invalidate entries; process restarts and additional instances can trigger new loads. Each instance holds its own cache, so there is no one-query-per-day guarantee.
The latest available snapshot may have an earlier reference date than the current day. Fast queries do not make that snapshot more recent. Freshness depends on upstream ingestion, processing, and cache renewal. The Real-Time name does not turn daily snapshots into continuous event updates.
Identity and access
The backend uses workload identity and Google identity tokens rather than an embedded static API key. The workload is the compute that runs the application. The browser never queries the warehouse directly. Table permissions and application authorization remain separate responsibilities.
What we measured
We used two sources with different boundaries:
- Databricks query history: the warehouse’s
total_duration_msfield. - Backend logs: elapsed time recorded within the SQL client implementation.
The p50 is the median; p95 describes the upper portion of the sampled distribution. Neither represents a guaranteed response time.
Query duration in Databricks
Q1 resolves the reference date. Q2 loads that date’s receivables. Q3 returns a grouped result covering 38 operation types in the observed dataset.
| Profile | Samples: previous / RT | Previous p50 (ms) | RT p50 (ms) | Reduction (ms) | Reduction (%) |
|---|---|---|---|---|---|
| Q1: reference date | 18 / 7 | 632 | 77 | 555 | 87.8 |
| Q2: approximately 29k receivables | 11 / 7 | 727 | 205 | 522 | 71.8 |
| Q3: grouping 38 operation types | 7 / 7 | 9,072 | 2,186 | 6,886 | 75.9 |
Q3 produced fewer rows than Q2, yet took longer in both environments. Returned row count alone does not describe the work needed to execute a query. Q3 also showed the largest absolute median improvement: 6,886 ms.
The 205 ms median for Q2 comes from Databricks query history. It is neither pure engine execution time nor full transfer time to the browser. Combining profiles would also mix different sample proportions; the table keeps those profiles separate.
Latency recorded by the backend
The previous-warehouse sample covers September 15-18, 2026, with 157 successful queries. The RT sample covers September 22-23, 2026, with 21 successful queries. Both date ranges use UTC.
| Metric | Previous (ms) | RT (ms) | Reduction (ms) | Reduction (%) |
|---|---|---|---|---|
| p50 | 3,039.46 | 2,350.69 | 688.77 | 22.7 |
| p95 | 7,770.16 | 3,905.61 | 3,864.55 | 49.7 |
| p99 | 11,663.67 | 4,198.65 | 7,465.02 | 64.0 |
| Observed maximum | 14,668.98 | 4,198.65 | 10,470.33 | 71.4 |
The relative improvement was larger at p95 than at the median. That indicates shorter long waits within these samples, not just a faster typical query. The RT p99 equals the observed maximum, reflecting the small sample size.
Where the timer starts and stops
The backend timer starts after token acquisition. It includes statement submission, polling when required, and response reading up to the log event. It stops before fetching any additional result chunks and mapping the returned rows.
| Included | Not included |
|---|---|
| SQL submission | Token acquisition |
| Execution polling | Additional result chunks |
| Response reading up to the event | Subsequent transformations and aggregations |
| API delivery and browser rendering |
The backend p95 therefore does not establish a sub-four-second page-load time. Subtracting independent medians would not isolate network, authentication, or aggregation costs either. That requires correlated measurements across stages of the same request.
Limits of the comparison
This was an observational comparison, not a controlled experiment with matched workloads. The following limits matter when interpreting the results:
- Seven RT executions per profile. High percentiles are sensitive to individual observations.
- Different periods and sample sizes. Load, capacity, and cache conditions were not controlled.
- Successful queries only. The samples do not measure failure rates or availability.
- Heuristic profile matching. Query text can be redacted, requiring context and result-shape matching.
- No sustained concurrency test. These measurements do not establish scaling behavior or a latency ceiling.
The evidence supports lower recorded durations in the observed RT samples. It does not isolate every cause or prove that cold starts were eliminated. It also does not establish financial savings, analyst productivity gains, or lower credit risk.
Engineering takeaways
Direct lakehouse access and in-process aggregation worked together in this measured MVP workload. The main trade-offs remain concrete: warehouse dependency, memory use, cache renewal, and authorization.
Three distinctions make the results useful beyond this implementation:
- Freshness is not latency. Always retain the reference date alongside portfolio metrics.
- Query time is not page-load time. Name each timer’s boundary before comparing measurements.
- A snapshot is not free. Account for transfer, memory, and repeated loads across instances.
The observed improvements are meaningful within those boundaries. Keeping the boundaries explicit makes the case reproducible and prevents a benchmark becoming a promise.
CERC operates the infrastructure of the Brazilian financial market for receivables registration. If you want to work on data engineering and architecture problems at real scale, check out our open positions.
This post was written by: Guilherme Araújo de Oliveira.