Performance¶
The Danish Parliament API is designed for high performance and reliability, serving thousands of requests daily while maintaining consistent response times.
Overview¶
The API provides excellent performance characteristics for most use cases:
- Average Response Time: 85ms - 2 seconds
- Availability: 99.9% uptime
- Concurrent Requests: Handles multiple simultaneous requests efficiently
- No Rate Limiting: Currently no enforced rate limits
Key Performance Topics¶
Response Times¶
Understand typical response times for different query types and what factors affect performance.
Query Limits¶
Learn about query size limits, maximum result counts, and pagination requirements.
Optimization¶
Best practices for optimizing your queries to achieve maximum performance.
Quick Performance Tips¶
1. Use Pagination¶
Always paginate large result sets to avoid timeouts:
2. Select Only Needed Fields¶
Use $select to reduce response size:
3. Avoid Deep Expansions¶
Limit $expand depth to maintain performance:
4. Cache Responses¶
Implement client-side caching for relatively static data like metadata and classification systems.
Performance Benchmarks¶
| Query Type | Typical Response Time | Max Results |
|---|---|---|
| Simple entity list | 85-200ms | 1000 |
| Filtered query | 100-500ms | 1000 |
| Single expansion | 200-800ms | 500 |
| Multiple expansions | 500-2000ms | 100 |
| Complex filters | 1-3 seconds | 100 |
Monitoring Performance¶
Track these metrics in your application:
- Response Times: Monitor average and p95 latency
- Error Rates: Track 5xx errors and timeouts
- Data Freshness: Check last update timestamps
- Query Efficiency: Measure records retrieved vs. needed
Handling Performance Issues¶
If you experience performance problems:
- Simplify Queries: Remove unnecessary expansions and filters
- Reduce Page Size: Use smaller
$topvalues - Implement Retry Logic: Handle transient failures gracefully
- Cache Aggressively: Store frequently accessed data locally
- Monitor Patterns: Identify and optimize slow queries
Performance Guarantees¶
While the API generally performs well, note:
- No formal SLA is provided
- Response times may vary during peak periods
- Large queries may timeout after 30 seconds
- Historical data queries may be slower
Best Practices Summary¶
✅ DO: - Use pagination for all queries - Select only required fields - Implement client-side caching - Handle errors gracefully - Monitor your usage patterns
❌ DON'T: - Request all fields unnecessarily - Use deep nested expansions - Ignore pagination - Make excessive concurrent requests - Rely on consistent sub-second responses
Related Topics¶
- Query Optimization - Detailed optimization techniques
- Pagination Strategies - Advanced pagination patterns
- Caching - Caching implementation guide
- Error Handling - Handling performance-related errors