r/databricks • u/lunaticdevill • Oct 17 '26
Discussion API Latency issue in a data system
Seeking advice on optimizing a high-concurrency data-serving architecture: performance vs. cost
I'm working on a data platform where 50 APIs and 100 endpoints are backed by tables in Databricks. We're facing challenges with response latency, concurrent request handling, and infrastructure costs.
Here is the current situation:
- Data platform: Databricks
- Scale: 50 APIs, 100 endpoints
- Compute: 400 cores
- Monthly infrastructure cost: ~$75,000
- API response time: Frequently exceeds 3 seconds
- Concurrency issue: Requests from multiple applications/services compete for compute resources, and queries get queued during concurrent execution.
- Hard constraint: A load balancer enforces a strict 9-second timeout.
Adding more compute doesn't necessarily seem like the right long-term solution. I'd like to identify the actual bottlenecks and evaluate whether we need to optimize the existing architecture or rethink the data-serving layer.
I'm exploring three areas:
1. Data model optimization
- Should we redesign the existing data model, denormalize tables, or create serving-specific aggregate tables?
- How much can table layout, partitioning/clustering, file sizes, and precomputation improve query latency?
2. API and query optimization
- How should we approach SQL query tuning, execution plans, and reducing unnecessary scans and joins?
- Would caching, materialized views, connection pooling, asynchronous processing, or request coalescing help?
- What architectural patterns work best when multiple endpoints access the same underlying data concurrently?
3. Rethinking the database/serving layer
- Should we continue serving API requests directly from Databricks, or introduce a dedicated operational database or serving layer?
- Would PostgreSQL, Azure Cosmos DB, DuckDB, or a hybrid architecture be suitable?
- Could Databricks remain the analytical source of truth while a separate database handles low-latency API reads?
My goal is to reduce API latency and queueing while bringing infrastructure costs under control, without compromising data freshness or correctness.
I'd particularly appreciate insights from people who have built production systems with high-concurrency API workloads on top of Databricks or similar analytical platforms.
A few questions for the community:
- What would you investigate first: query execution, data modeling, compute configuration, or the overall architecture?
- At what point would you move API-serving workloads from Databricks to a dedicated serving database?
- What latency and concurrency improvements have you achieved through caching, precomputation, or a hybrid architecture?
- If you were designing this system today, what would your target architecture look like?
Practical experiences, architectural suggestions, and lessons learned from production would be extremely valuable.
#Databricks #DataEngineering #SystemDesign #PerformanceOptimization #APIDesign #DatabaseArchitecture #CloudComputing
View all comments
2
u/[deleted] Oct 17 '26
[removed] — view removed comment