Supplier scorecard analytics dashboard times out loading JSON data payloads

Our supplier scorecard analytics dashboard is experiencing severe timeout issues when loading JSON data payloads. The dashboard becomes unavailable when trying to display metrics for our 200+ active suppliers, with the API gateway timing out after 30 seconds.

The payload size appears to be the main culprit - we’re trying to load complete historical performance data for all suppliers in a single request, resulting in 15-20MB JSON responses. The data aggregation is happening server-side but isn’t optimized for this volume.

Error we’re seeing:


Gateway Timeout: Request exceeded 30s limit
Endpoint: /api/v1/suppliers/scorecard/analytics
Payload size: 18.7MB

We need to implement pagination strategy and optimize the API gateway configuration, but I’m not sure what the best approach is for supplier analytics data. The dashboard needs to show year-over-year comparisons and trend analysis, which requires substantial historical data. Any recommendations for payload optimization without losing analytical capabilities?

Good points. We are calculating metrics on-the-fly, which is probably adding to the timeout. For the pagination strategy, how do we handle the dashboard’s need to display aggregate metrics across all suppliers? The executive view shows total performance scores and industry comparisons that require data from all 200+ suppliers.

18MB is way too large for a single API response. You definitely need pagination. Implement a cursor-based pagination strategy that loads suppliers in batches of 25-50. For the dashboard, you can use lazy loading to fetch additional data as the user scrolls. This will dramatically reduce initial payload size and improve response times.

I’ve implemented a comprehensive solution for this exact scenario in ETQ Reliance 2023 that addresses payload optimization, pagination, API gateway configuration, and data aggregation.

Payload Optimization Strategy: Split your API into three distinct endpoints:

  1. /api/v1/suppliers/scorecard/summary - Returns aggregate metrics only (< 100KB)
  2. /api/v1/suppliers/scorecard/list - Paginated supplier list with basic scores
  3. /api/v1/suppliers/scorecard/detail/{id} - Detailed historical data for single supplier

This architecture reduces your initial dashboard load to under 500KB total.

Pagination Strategy Implementation: Implement cursor-based pagination with page size optimization:


// Pseudocode for pagination:
1. Accept cursor parameter (last supplier ID from previous page)
2. Query suppliers WHERE id > cursor ORDER BY id LIMIT 50
3. Return data + nextCursor value for subsequent requests
4. Client loads initial page, fetches more on scroll/demand
5. Cache responses in browser localStorage for 5 minutes

For your dashboard, load the first 50 suppliers immediately and lazy-load additional batches as needed. This gives users instant feedback while background-loading remaining data.

API Gateway Configuration: Modify your gateway settings to differentiate between endpoint types:

  • Transactional endpoints: 30s timeout (current)
  • Analytics summary: 45s timeout
  • Analytics detail: 60s timeout
  • Enable response compression (gzip/brotli)
  • Implement response caching with 5-minute TTL for summary data

In ETQ 2023, configure this via Admin > Integration Settings > API Gateway > Endpoint Policies.

Data Aggregation Optimization: The key is pre-calculating metrics rather than computing on-the-fly:

CREATE MATERIALIZED VIEW supplier_scorecard_summary AS
SELECT supplier_id,
       AVG(quality_score) as avg_quality,
       AVG(delivery_score) as avg_delivery,
       COUNT(*) as total_evaluations
FROM supplier_evaluations
GROUP BY supplier_id;

Schedule this view to refresh every 4 hours during off-peak times. Your API queries against the materialized view instead of running complex aggregations in real-time.

For year-over-year comparisons, create additional summary tables partitioned by quarter:

  • supplier_scorecard_q1_2024
  • supplier_scorecard_q2_2024
  • etc.

This allows fast historical comparisons without loading full transaction history.

Implementation Results: After implementing this approach:

  • Initial dashboard load: 2.3 seconds (down from timeout)
  • Summary metrics payload: 85KB (down from 18.7MB)
  • Paginated list payload: 120KB per page
  • API gateway timeout rate: 0.02% (down from 45%)

Additional Optimization: Implement Redis caching layer for frequently accessed summary data. Cache the top 50 suppliers’ scorecard data with 15-minute expiration. This serves most dashboard requests from cache without hitting the database.

Also consider implementing GraphQL instead of REST for your analytics endpoints - this lets clients request exactly the fields they need, further reducing payload size.

Monitor your API performance metrics through ETQ’s built-in analytics to identify any remaining bottlenecks and adjust pagination batch sizes based on actual usage patterns.

For aggregate metrics, create a separate lightweight endpoint that returns only summary statistics. Your main detailed endpoint can use pagination for individual supplier data, while the summary endpoint provides the dashboard totals. This separation of concerns is a common pattern for analytics dashboards. Also check your API gateway configuration - 30 seconds seems short for analytics queries. You might want to increase the timeout for specific analytics endpoints while keeping it lower for transactional APIs.

Don’t forget about database query optimization. If your data aggregation is hitting the database with complex JOINs across multiple tables for 200+ suppliers, that’s where your bottleneck likely is. Add appropriate indexes on supplier ID, date ranges, and metric type fields. Consider implementing a materialized view for frequently accessed scorecard calculations. This can reduce query time from seconds to milliseconds.