Design: Microservices with Fallback Pattern
Design the fallback pattern implementation in a microservices architecture including fallback triggers, fallback response types, monitoring, and integration with service calls. Out of scope: detailed UI design, database schema beyond caching fallback data.
Functional Requirements
FR1: The system consists of multiple microservices communicating over the network.
FR2: When a microservice call fails or is slow, the system should provide a fallback response to maintain user experience.
FR3: Fallback responses can be default static data, cached data, or a degraded service response.
FR4: The system should log fallback events for monitoring and alerting.
FR5: Fallbacks should not cause cascading failures or block the system.
FR6: The system should handle up to 10,000 concurrent requests with p99 latency under 300ms.
Non-Functional Requirements
NFR1: Availability target: 99.9% uptime (max 8.77 hours downtime per year).
NFR2: Fallback responses must be returned within 100ms after detecting failure or timeout.
NFR3: Microservices communicate via REST or gRPC.
NFR4: Fallback logic should be configurable per service.
NFR5: System must avoid blocking threads during fallback handling.