Overview
These endpoints demonstrate three different approaches to fetching cryptocurrency market data, showcasing KrakenD’s caching and concurrent processing capabilities. Endpoints:GET /market/cached- With HTTP caching enabledGET /market/simple- Standard processingGET /market/concurrent- With concurrent calls enabled
What It Demonstrates
- HTTP Caching: Backend response caching to reduce API calls
- Concurrent Calls: Parallel processing for improved performance
- Performance Comparison: Different strategies for the same data
GET /market/cached
Description
Fetches cryptocurrency market data with HTTP caching enabled at the backend level. Responses are cached and shared across requests.Request Example
Expected Response
Configuration
Key Features
HTTP Cache (qos/http-cache):
- Shared:
true- Cache is shared across all concurrent requests - Behavior: Respects HTTP cache headers from the backend (CoinGecko API)
- Benefits: Reduces backend API calls, improves response times, lowers costs
GET /market/simple
Description
Fetches the same cryptocurrency market data without caching or concurrent processing. This is the baseline configuration.Request Example
Expected Response
Same structure as/market/cached.
Configuration
Key Features
- No caching configured
- No concurrent processing
- Standard sequential execution
- Useful as a baseline for performance comparison
GET /market/concurrent
Description
Fetches cryptocurrency market data with concurrent calls enabled. This allows KrakenD to make the same request multiple times in parallel.Request Example
Expected Response
Same structure as other market endpoints.Configuration
Key Features
Concurrent Calls:- concurrent_calls:
3- Makes 3 parallel requests to the same backend - Behavior: Returns the fastest successful response
- Benefits: Improved reliability and latency in unstable networks
- Trade-off: Increases backend load by 3x
Performance Comparison
| Endpoint | Caching | Concurrent Calls | Best Use Case |
|---|---|---|---|
/market/cached | ✅ Yes | ❌ No | High-traffic APIs with stable data |
/market/simple | ❌ No | ❌ No | Real-time data, low traffic |
/market/concurrent | ❌ No | ✅ Yes (3x) | Unreliable backends, latency-critical |
Backend Service
All three endpoints call the same backend:- Host:
https://api.coingecko.com - URL:
/api/v3/coins/markets - Parameters:
vs_currency=eurids=bitcoin,ethereumorder=market_cap_descper_page=100page=1sparkline=false
Use Cases
/market/cached
- Public market data APIs
- Dashboard applications
- Reducing third-party API costs
- High-traffic scenarios
/market/simple
- Real-time trading data
- Low-latency requirements
- Frequently changing data
/market/concurrent
- Unreliable network conditions
- Mission-critical applications
- Geographic distribution with varying latency
- Failover scenarios