Fail-Open vs. Fail-Closed Decision Matrix for Dependencies
As Sherlock, I deduce this request pertains to resilient system architecture, where fail-open (default to allowing access/traffic on failure) prioritizes availability but risks security/exposure, and fail-closed (default to denying/blocking) prioritizes security but risks denial-of-service (DoS). The matrix below is a reusable template applied per dependency (e.g., auth service, database, cache, external API).
Key Principles
- Evaluate per dependency: Score each criterion on impact (High/Medium/Low) for both failure modes.
- Scoring: +1 for favorable (low risk/high benefit), 0 neutral, -1 unfavorable (high risk/low benefit). Total score decides:
- Fail-Open if total ≥ 0 (availability bias).
- Fail-Closed if total < 0 (security bias).
- Hybrid if tied (e.g., circuit breaker with timeout).
- Thresholds: Customize weights (e.g., multiply Security by 2x) based on system SLOs.
- Mitigations: Always pair with health checks, circuit breakers (e.g., via Istio/Envoy), and fallback policies.
Decision Criteria (Universal Set)
| Criterion | Description | Fail-Open Impact | Fail-Closed Impact |
|---|
| Security Exposure | Risk of unauthorized access/data leak on failure. | High (-1): Bypasses checks. | Low (+1): Blocks all. |
| Availability/DoS Risk | User impact from blocked access. | Low (+1): Traffic flows. | High (-1): Legit users denied. |
| Data Integrity | Risk of corrupted/inconsistent state. | Med (0): May allow bad data. | Low (+1): Prevents writes. |
| MTTR (Recovery Time) | Time to restore dependency. | Med (0): Users unaffected short-term. | High (-1) if >5min: Prolonged outage. |
| Blast Radius | Users/systems affected. | High (-1) for core deps. | Med (0): Localized DoS. |
| Dependency Criticality | Must-have (auth/DB) vs nice-to-have (cache). | Low (+1) for non-critical. | High (-1) for critical. |
| External vs Internal | Vendor APIs vs in-house services. | Med (0): SLAs mitigate. | Low (+1): Failures isolated. |
| Idempotency | Operations safe to retry. | Low (+1): Retries ok. | Med (0): Blocks retries. |
Example Matrices Per Dependency Type
Apply the template to common dependencies. Scores are illustrative; adjust per your system.
1. Authentication Service (e.g., OAuth/JWT validator)
| Criterion | Fail-Open Score | Fail-Closed Score |
|---|
| Security Exposure | -1 | +1 |
| Availability/DoS | +1 | -1 |
| Data Integrity | 0 | +1 |
| MTTR | 0 | -1 |
| Blast Radius | -1 | 0 |
| Criticality | -1 | -1 |
| External/Internal | 0 | +1 |
| Idempotency | +1 | 0 |
| Total | -1 | +1 |
| Decision: Fail-Closed (security > availability; fallback to anon mode if hybrid). | | |
2. Primary Database (e.g., PostgreSQL for transactions)
| Criterion | Fail-Open Score | Fail-Closed Score |
|---|
| Security Exposure | 0 | +1 |
| Availability/DoS | +1 | -1 |
| Data Integrity | -1 | +1 |
| MTTR | 0 | -1 |
| Blast Radius | -1 | 0 |
| Criticality | -1 | -1 |
| External/Internal | +1 | +1 |
| Idempotency | 0 | 0 |
| Total | -1 | +1 |
| Decision: Fail-Closed (protect integrity; read-only replica fallback). | | |
3. Cache (e.g., Redis for sessions)
| Criterion | Fail-Open Score | Fail-Closed Score |
|---|
| Security Exposure | 0 | +1 |
| Availability/DoS | +1 | -1 |
| Data Integrity | 0 | +1 |
| MTTR | +1 | 0 |
| Blast Radius | 0 | 0 |
| Criticality | +1 | +1 |
| External/Internal | 0 | +1 |
| Idempotency | +1 | 0 |
| Total | +4 | +4 |
| Decision: Hybrid (fail-open to origin; TTLs prevent stale data). | | |
4. External Payment API (e.g., Stripe)
| Criterion | Fail-Open Score | Fail-Closed Score |
|---|
| Security Exposure | -1 | +1 |
| Availability/DoS | +1 | -1 |
| Data Integrity | 0 | +1 |
| MTTR | +1 | 0 |
| Blast Radius | 0 | 0 |
| Criticality | 0 | 0 |
| External/Internal | -1 | +1 |
| Idempotency | +1 | 0 |
| Total | +1 | +2 |
| Decision: Fail-Closed (queue payments; retry on recovery). | | |
5. Load Balancer/Proxy (e.g., NGINX/Envoy)
| Criterion | Fail-Open Score | Fail-Closed Score |
|---|
| Security Exposure | -1 | +1 |
| Availability/DoS | +1 | -1 |
| Data Integrity | 0 | +1 |
| MTTR | +1 | 0 |
| Blast Radius | -1 | -1 |
| Criticality | -1 | -1 |
| External/Internal | +1 | +1 |
| Idempotency | +1 | 0 |
| Total | +1 | +0 |
| Decision: Fail-Open (direct to backends via DNS failover). | | |
Implementation Guidance
- Tools: Use Prometheus for health checks, Consul for service discovery, or Kubernetes liveness probes.
- Testing: Chaos engineering (e.g., Gremlin) to validate failure modes.
- Review Cadence: Reassess quarterly or post-incident.
- Edge Cases: For zero-downtime, layer with blue-green deploys.
This matrix ensures deductive, data-driven choices. Provide specifics on your dependencies for tailored scoring. Elementary?