PromptBase
PromptBase SelectGet Select
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
(claude-5-5-sonnet)
Token size
2,731
Example input
[DESCRIBE THE SYSTEM, SERVICES, COMPONENTS, INFRASTRUCTURE, AND MAJOR DEPENDENCIES]: An e-commerce platform with: - API Gateway - Order Service - Payment Service - Inventory Service - PostgreSQL database - Kafka event queue - Notification Service - Redis cache [DESCRIBE THE FAILURE, CHANGE, INCIDENT, OR EVENT THAT STARTED THE ANALYSIS]: PostgreSQL becomes unavailable during peak traffic because of a database connection exhaustion event. [PROVIDE SERVICE, DATA, API, DATABASE, QUEUE, INFRASTRUCTURE, OR WORKFLOW DEPENDENCIES]: API Gateway β†’ Order Service Order Service β†’ PostgreSQL Order Service β†’ Kafka Payment Service β†’ PostgreSQL Inventory Service β†’ PostgreSQL Kafka β†’ Notification Service Redis β†’ Order Service [DESCRIBE HOW REQUESTS, DATA, EVENTS, OR OPERATIONS MOVE THROUGH THE SYSTEM]: Customer β†’ API Gateway β†’ Order Service β†’ PostgreSQL β†’ Kafka β†’ Notification Service Inventory reservation also depends on PostgreSQL. [DESCRIBE WHAT SHOULD HAVE HAPPENED AND WHERE THE CASCADE SHOULD HAVE STOPPED]: Database failures should be isolated by timeouts, bounded retries, graceful degradation, and queue-based processing.
Example output
# πŸ”Ž PHASE 1 β€” SYSTEM CONTEXT RECONSTRUCTION The available evidence supports the following simplified architecture: ```text Customer ↓ API Gateway ↓ Order Service ↓ PostgreSQL ↓ Kafka ↓ Notification Service Order Service ──→ Redis Inventory Service ──→ PostgreSQL Payment Service ──→ PostgreSQL ``` ### Dependency Classification | Dependency | Type | |---|---| | API Gateway β†’ Order Service | Synchronous | | Order Service β†’ PostgreSQL | Synchronous / Data | | Payment Service β†’ PostgreSQL | Data | | Inventory Service β†’ PostgreSQL | Data | | Order Service β†’ Kafka | Asynchronous | | Kafka β†’ Notification Service | Asynchronous | | Redis β†’ Order Service | Infrastructure / Cache | ⚠️ **Important:** The existence of these dependencies does not prove that every component participated in the actual cascade. --- # πŸ”Ž PHASE 2 β€” INITIATING EVENT RECONSTRUCTION ### Confirmed Event PostgreSQL reached its maximum connection capacity and became unavailable to dependent operations. Evidence: - Database connection capacity was exhausted. - Order API latency increased afterward. - Requests began timing out. ### Suspected Trigger A high-volume workload combined with connection consumption is a plausible trigger. However, the available evidence does **not** establish exactly why the connection pool was exhausted. Possible causes could include: - excessive concurrent requests - slow database queries - connection leaks - insufficient connection-pool configuration These remain hypotheses unless additional evidence is provided. --- # πŸ”Ž PHASE 3 β€” DEPENDENCY GRAPH The relevant propagation graph is: ```text PostgreSQL failure ↓ Order Service ↓ Order requests ↓ Customer impact PostgreSQL failure ↓ Inventory Service ↓ Delayed inventory updates PostgreSQL failure ↓ Payment Service ↓ Potential payment-operation impact ``` A separate asynchronous path is: ```text Order Service ↓ Kafka ↓ Notification Service ``` But the evidence only establishes that Kafka order events decreased. It does **not** prove that Notification Service itself failed. --- # πŸ”Ž PHASE 4 β€” DIRECT IMPACT ANALYSIS ### Directly affected component **PostgreSQL** State: - Connection capacity exhausted - Database operations unavailable or severely degraded ### Immediate dependent effects **Order Service** - Database requests become slow or fail. - Request latency increases. - Requests begin timing out. **Inventory Service** - Database-dependent inventory operations are delayed. **Payment Service** - Potentially affected because it depends on PostgreSQL, but no direct payment failure evidence was supplied. ### Evidence Confidence | Component | Impact | Confidence | |---|---|---| | PostgreSQL | Connection exhaustion | Confirmed | | Order Service | Timeouts | Confirmed | | Inventory Service | Delayed updates | Confirmed | | Payment Service | Failure | Unconfirmed | | Notification Service | Failure | Unconfirmed | --- # πŸ”Ž PHASE 5 β€” PROPAGATION PATH ANALYSIS ## Path 1 β€” Order Path ```text Database connection exhaustion β†’ Order Service database calls β†’ Increased latency β†’ Request timeouts β†’ Customer order failures/delays ``` ### Mechanism Order Service requires PostgreSQL to complete database operations. ### Evidence - Database capacity exhausted - Order latency increased - Order requests timed out ### Confidence **High** --- ## Path 2 β€” Inventory Path ```text Database connection exhaustion β†’ Inventory database operations β†’ Delayed inventory updates β†’ Operational inconsistency/delay ``` ### Mechanism Inventory Service depends on PostgreSQL. ### Evidence Inventory updates were observed to be delayed. ### Confidence **High** --- ## Path 3 β€” Kafka Path ```text Database degradation β†’ Order processing degradation β†’ Fewer order events β†’ Reduced Kafka order events β†’ Notification processing receives fewer events ``` This is a propagation effect, but it is important not to incorrectly describe Kafka as having failed. ### Confidence **Moderate to high** --- # πŸ”Ž PHASE 6 β€” CASCADE DEPTH ANALYSIS ## Depth 0 β€” Initiating Event **PostgreSQL connection exhaustion** --- ## Depth 1 β€” Directly Affected - Order Service - Inventory Service - Payment Service dependency path The first two have evidence of impact. Payment impact remains unconfirmed. --- ## Depth 2 β€” Downstream Effects ### Order path ```text Order Service β†’ Order request timeouts β†’ Customer order impact ``` ### Inventory path ```text Inventory Service β†’ Delayed inventory updates β†’ Operational impact ``` ### Event path ```text Order Service β†’ Reduced Kafka events β†’ Reduced downstream notification activity ``` ### Cascade Table | Depth | Components | Mechanism | Evidence | Impact | |---|---|---|---|---| | 0 | PostgreSQL | Connection exhaustion | Confirmed | Database degradation | | 1 | Order Service | DB calls fail/slow | Confirmed | Order latency/timeouts | | 1 | Inventory Service | DB dependency | Confirmed | Delayed updates | | 1 | Payment Service | DB dependency | Unconfirmed | Unknown | | 2 | Customer orders | Request timeout | Confirmed | Failed/delayed orders | | 2 | Kafka flow | Reduced order events | Confirmed | Lower event throughput | | 2 | Notifications | Fewer upstream events | Indirect | Activity reduction | πŸ“Œ **Established cascade depth: approximately Depth 2.** The evidence does not establish a deeper failure cascade. --- # πŸ”Ž PHASE 7 β€” CASCADE AMPLIFICATION ANALYSIS The strongest potential amplification mechanism is: ## πŸ” Retry Amplification When database requests become slow: ```text Database slowdown β†’ Request timeout β†’ Retry β†’ Additional database request β†’ More connection pressure β†’ More slowdown ``` This creates a potential feedback loop. However, the supplied evidence only confirms that **application retries increased**. Therefore: **Retry amplification is strongly supported as a mechanism.** ### Amplifying Mechanism **Retries** ### Affected Layer Application β†’ Database ### Containment Opportunity - exponential backoff - retry limits - circuit breakers - connection-pool protection - request shedding --- # πŸ”Ž PHASE 8 β€” FAN-OUT / FAN-IN / CONVERGENCE ## 🌳 Fan-Out One shared database dependency affects multiple services: ```text β”Œβ†’ Order Service PostgreSQL ───┼→ Inventory Service β””β†’ Payment Service ``` This creates a **shared dependency blast radius**. --- ## πŸ”— Fan-In Multiple services depend on the same PostgreSQL resource. Therefore: ```text Order Service ───┐ Inventory ───────┼→ PostgreSQL Payment β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` This creates convergence on one shared resource. ### Result A single database resource can become a common propagation point for several otherwise independent workflows. --- # πŸ”Ž PHASE 9 β€” TEMPORAL CASCADE ANALYSIS Likely observed sequence: ```text T0 PostgreSQL connection capacity exhausted ↓ T1 Database operations degrade ↓ T2 Order Service latency increases ↓ T3 Requests begin timing out ↓ T4 Application retries increase ↓ T5 Order event production decreases ↓ T6 Inventory updates become delayed ``` ⚠️ The exact timestamps are unavailable, so this represents the **supported causal ordering**, not fabricated timing data. --- # πŸ”Ž PHASE 10 β€” CASCADE BOUNDARY & CONTAINMENT The cascade appears to encounter several potential boundaries. ### Existing/Expected Controls - timeouts - retries - queues - circuit breakers - graceful degradation ### Current Weakness The increased retry behavior suggests that retries may have contributed to additional database pressure. Potential boundary: ```text Order Service ↓ Circuit Breaker ↓ PostgreSQL ``` If the database is unhealthy, the circuit breaker could stop repeated requests instead of continuously increasing pressure. --- # πŸ”Ž PHASE 11 β€” BLAST RADIUS ## Observed Impact - PostgreSQL operations - Order Service - Order requests - Inventory updates - Kafka order-event flow ## Unconfirmed Impact - Payment operations - Notification Service failure - Other external systems ### Important distinction The blast radius is **not automatically every service connected to PostgreSQL**. Only components with observed or defensible propagation should be included. --- # πŸ”Ž PHASE 12 β€” CASCADE REPRODUCTION & VALIDATION Do **not** reproduce this by intentionally taking down production PostgreSQL. Use a controlled staging environment. ## πŸ§ͺ Test 1 β€” Database Failure ### Initiating Condition Simulate PostgreSQL unavailability in staging. ### Expected First Impact Order Service database requests fail. ### Expected Propagation ```text PostgreSQL β†’ Order Service β†’ Controlled request failures ``` ### Expected Stopping Point The cascade should stop at the Order Service boundary rather than spreading uncontrollably. ### Telemetry Monitor: - database connections - request latency - timeout rate - retry count - queue depth - error rate - CPU/memory - Kafka throughput ### Success Criteria - retries remain bounded - database connection pressure does not continuously increase - dependent services remain isolated - recovery does not create another spike --- # πŸ”Ž PHASE 13 β€” CASCADE MITIGATION | Propagation Mechanism | Mitigation | |---|---| | Retry amplification | Exponential backoff + retry limits | | Database overload | Connection-pool limits | | Slow requests | Strict timeouts | | Shared dependency failure | Circuit breakers | | Traffic overload | Rate limiting/load shedding | | Order processing failure | Queue-based buffering | | Inventory dependency | Graceful degradation where safe | | Shared database blast radius | Service/database isolation where justified | ### Key Principle Do not redesign the entire architecture solely because one cascade occurred. First address the mechanisms actually demonstrated by the incident. --- # πŸ”Ž PHASE 14 β€” RECOVERY & CASCADE INTERRUPTION Recommended recovery sequence: ### 1. Stabilize PostgreSQL Restore database availability and verify connection capacity. ### 2. Stop Retry Amplification Temporarily maintain bounded retries and prevent uncontrolled request storms. ### 3. Keep Dependent Services Controlled Do not immediately release full traffic. ### 4. Validate Database Health Check: - connection utilization - query latency - error rate - transaction behavior ### 5. Gradually Restore Traffic Increase traffic progressively. ### 6. Re-enable Dependencies Restore normal processing after validation. ### 7. Monitor Secondary Effects Especially: - queue backlog - duplicate processing - inventory consistency - notification backlog - connection spikes --- # πŸ”Ž PHASE 15 β€” CASCADE RISK & PRIORITIZATION ## Risk 1 β€” Retry Feedback Loop **Propagation:** ```text DB degradation β†’ timeout β†’ retry β†’ additional DB load β†’ further degradation ``` **Cascade depth:** Potentially increases Depth 1 β†’ Depth 2. **Mitigation:** Bounded retries and exponential backoff. **Validation:** Controlled database degradation test. --- ## Risk 2 β€” Shared Database Dependency **Propagation:** ```text PostgreSQL β†’ Order β†’ Inventory β†’ Payment dependency paths ``` **Cascade depth:** Multiple Depth 1 branches. **Mitigation:** Dependency isolation and appropriate bulkheads. **Validation:** Controlled database failure with independent service monitoring. --- ## Risk 3 β€” Recovery Surge Potential sequence: ```text Database recovers β†’ queued/retried requests resume β†’ sudden traffic spike β†’ database pressure increases again ``` **Mitigation:** - gradual traffic restoration - queue draining controls - bounded retries - connection limits --- # πŸ† PHASE 16 β€” FINAL CASCADE DEPTH REPORT ## 1. Executive Summary The initiating event was PostgreSQL connection exhaustion. The strongest evidence shows propagation into Order Service and Inventory Service, with increased retries providing a plausible amplification mechanism. The established cascade reaches approximately **Depth 2**. The evidence does not establish that every PostgreSQL-dependent service failed. --- ## 2. Initiating Event **PostgreSQL connection capacity exhaustion.** Cause of the exhaustion remains unresolved from the supplied evidence. --- ## 3. System & Dependency Map ```text Customer ↓ API Gateway ↓ Order Service ↓ PostgreSQL ↓ Kafka ↓ Notification Service Inventory Service ──→ PostgreSQL Payment Service ────→ PostgreSQL ``` --- ## 4. Direct Impact Confirmed: - PostgreSQL degradation - Order Service degradation - Inventory update delays Unconfirmed: - Payment Service failure - Notification Service failure --- ## 5. Propagation Paths ### Primary ```text PostgreSQL β†’ Order Service β†’ Request timeouts β†’ Customer order impact ``` ### Secondary ```text PostgreSQL β†’ Inventory Service β†’ Delayed inventory updates ``` ### Event-flow effect ```text Order degradation β†’ Reduced Kafka events β†’ Reduced downstream notification activity ``` --- ## 6. Cascade Depth | Depth | Components | Mechanism | Evidence | Impact | |---|---|---|---|---| | 0 | PostgreSQL | Connection exhaustion | Confirmed | DB degradation | | 1 | Order Service | DB dependency | Confirmed | Timeouts | | 1 | Inventory Service | DB dependency | Confirmed | Delays | | 2 | Customer orders | Request timeout | Confirmed | Order disruption | | 2 | Kafka flow | Reduced events | Confirmed | Lower throughput | --- ## 7. Amplification Analysis Primary supported mechanism: **Retry amplification** ```text Timeout β†’ Retry β†’ More DB pressure β†’ More timeout ``` --- ## 8. Fan-Out / Fan-In Analysis PostgreSQL acts as a shared dependency. Multiple services converge on the same database, creating a potential fan-in bottleneck and multi-service fan-out when the dependency becomes unhealthy. --- ## 9. Temporal Propagation ```text Connection exhaustion β†’ DB degradation β†’ Order latency β†’ Timeouts β†’ Increased retries β†’ Reduced events β†’ Delayed downstream operations ``` Exact timestamps were not supplied. --- ## 10. Containment Boundaries Most important containment opportunities: - database connection limits - request timeouts - bounded retries - circuit breakers - rate limiting - queue buffering - gradual recovery --- ## 11. Blast Radius **Observed:** - PostgreSQL - Order Service - Inventory workflow - customer order processing - Kafka order-event flow **Not established:** - Payment Service failure - Notification Service failure - unrelated infrastructure failure --- ## 12. Recovery Sequence ```text Stabilize PostgreSQL ↓ Control retries ↓ Validate database health ↓ Keep dependent traffic controlled ↓ Gradually restore traffic ↓ Drain queues safely ↓ Validate downstream systems ``` --- ## 13. Mitigation Architecture ```text β”Œβ†’ Order Service β”‚ ↓ Customer β†’ API ─── Circuit Breaker β”‚ ↓ β””β†’ PostgreSQL ↑ Connection Limits ↑ Retry Controls ``` The objective is to prevent one unhealthy dependency from turning into an uncontrolled system-wide feedback loop. --- ## 14. Validation Tests ### Test A Controlled PostgreSQL unavailability in staging. ### Test B Controlled database latency injection. ### Test C Retry-storm simulation. ### Test D Connection-pool exhaustion simulation. ### Test E Recovery with gradual traffic restoration. ### Test F Queue backlog recovery validation. For every test, measure: - latency - errors - retries - connection usage - queue depth - downstream failures - recovery time --- ## 15. Remaining Uncertainty The following remain unresolved: - Exact root cause of connection exhaustion - Whether Payment Service actually failed - Whether Notification Service experienced failure - Exact timestamps between propagation stages - Exact number of affected requests/users - Whether retries materially worsened the database condition or merely correlated with it These require additional logs, traces, metrics, and configuration evidence. --- # 🌊 FINAL CASCADE ANALYSIS ```text TRIGGER PostgreSQL connection exhaustion ↓ DIRECT IMPACT Order + Inventory database operations ↓ PROPAGATION Timeouts + delayed processing ↓ CASCADE DEPTH Established approximately Depth 2 ↓ AMPLIFICATION Retry-driven feedback pressure ↓ BLAST RADIUS Orders + inventory + event flow ↓ CONTAINMENT Timeouts + bounded retries + circuit breakers ↓ RECOVERY Database β†’ controlled traffic β†’ queues β†’ downstream validation ``` **Key finding:** The important question is not simply "Which services depend on PostgreSQL?" It is **which dependencies actually participated in the observed causal chain, through what mechanism, and how far that mechanism propagated.**
Claude

Cascade Depth Analyst

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-5-SONNET
Tested icon
Guide icon
4 examples icon
Free credits icon
Cascade Depth Analyst maps how a failure propagates through dependencies, identifies the depth and paths of the cascade, analyzes amplification and blast radius, and produces practical containment and recovery recommendations. Turn a single failure into a complete Trigger β†’ Propagation β†’ Cascade Depth β†’ Impact β†’ Containment β†’ Recovery analysis.
...more
Added over 1 month ago
Report
Browse Marketplace