A delivery logistics app uses a Geocoding API to convert addresses to coordinates. The Address Service caches results in Redis (24h TTL). A background Batch Processor also geocodes new addresses from bulk CSV uploads. Both share the same API key with a 1000 requests/hour limit.
[2024-08-20 14:00:01] INFO: Geocode request for "123 Main St, Springfield"
[2024-08-20 14:00:01] INFO: Cache MISS for "123 Main St, Springfield"
[2024-08-20 14:00:01] INFO: Calling geocoding API...
[2024-08-20 14:00:02] INFO: API response: 200 OK. Coordinates: (39.7817, -89.6501)
[2024-08-20 14:00:02] INFO: Cached result with key "geo:123_main_st_springfield" TTL=86400s
[2024-08-20 14:05:00] INFO: Geocode request for "456 Oak Ave, Portland"
[2024-08-20 14:05:00] INFO: Cache MISS for "456 Oak Ave, Portland"
[2024-08-20 14:05:00] INFO: Calling geocoding API...
[2024-08-20 14:05:00] ERROR: API response: 429 Too Many Requests. Rate limit exceeded.
[2024-08-20 14:05:00] ERROR: Geocoding failed for "456 Oak Ave, Portland"
[2024-08-20 14:10:15] INFO: Geocode request for "123 Main St, Springfield"
[2024-08-20 14:10:15] INFO: Cache MISS for "123 Main St, Springfield"
[2024-08-20 14:10:15] INFO: Calling geocoding API...
[2024-08-20 14:10:15] ERROR: API response: 429 Too Many Requests.