Cap Theorem medium
Service A calls Service B. Service B is down. A returns a fallback (cached) response. This choice favors:
- A Availability (AP) over Consistency, prioritizing an immediate response over perfect real-time data accuracy.
- B Consistency (CP) over Availability, ensuring that the user only sees data that is proven to be 100% correct.
- C Partition Tolerance (P) over Latency, favoring a slow but correct response over an immediate stale one.
- D Security over Speed, prioritizing the cryptographic verification of the response before it is served to the user.
Answer: A. Availability (AP) over Consistency, prioritizing an immediate response over perfect real-time data accuracy.
In a microservices architecture, implementing 'Graceful Degradation' is an AP-centric choice. If a downstream service is down, returning a 'Fallback' (like a cached or default value) ensures that the user's request is satisfied (High Availability). The alternative—returning an error—would preserve Consistency (by not serving stale or incorrect data) but would degrade the user experience and overall system uptime.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is a 'Split Brain' scenario?
- The PACELC theorem extends CAP by stating: Even when there is NO partition (E), the system must choose between:
- Why is a CA (Consistent + Available) system generally considered impossible for distributed web applications?
- In CAP, 'Consistency' is equivalent to:
- In the CAP Theorem, what does the 'P' stand for?
- What causes a Network Partition?