System Design Analysis
Analyze distributed system designs for scalability, reliability, performance, and security. Produce structured review documents with gaps and actionable recommendations.
Core Principle
System design is about trade-offs, not perfect answers. Every recommendation must consider context: access patterns, scale requirements, consistency needs, and operational constraints.
Workflow
Phase 1: Information Gathering
Ask focused questions to understand the system. Prioritize these areas:
- Functional scope: What does the system do? Core operations?
- Scale: Expected QPS, data volume, user count?
- Access patterns: Read-heavy vs write-heavy? Hot spots?
- Consistency requirements: Strong vs eventual? Where?
- Availability targets: SLA requirements? Acceptable downtime?
- Current architecture: Existing components, databases, services?
- Known pain points: What's broken or struggling today?
Limit to 3-5 questions per message. Make reasonable assumptions when information is missing—document assumptions explicitly.
Phase 2: Topic Analysis
Based on gathered information, analyze relevant system design topics. Load reference files as needed:
| Topic |
Reference File |
When to Load |
| Load balancing |
load-balancing.md |
Traffic distribution, L4/L7 decisions |
| Caching |
caching.md |
Latency optimization, read scaling |
| Databases |
databases.md |
Data modeling, SQL vs NoSQL choices |
| CAP & Consistency |
cap-consistency.md |
Consistency model decisions |
| Sharding |
sharding-partitioning.md |
Write/storage scaling |
| Replication |
replication.md |
Availability, read scaling |
| Message queues |
message-queues.md |
Async processing, decoupling |
| Rate limiting |
rate-limiting.md |
Traffic protection, abuse prevention |
| Auth |
auth.md |
Security, identity management |
| Resilience |
resilience-patterns.md |
Failure handling, fault tolerance |
| Monitoring |
monitoring-observability.md |
Observability, debugging |
Load only topics relevant to the specific system under review.
Phase 3: Document Generation
Produce a structured analysis document with these sections:
# System Design Analysis: [System Name]
## 1. Abstract
Brief summary of the system and analysis scope (2-3 paragraphs).
## 2. Requirements
### 2.1 Stated Requirements
Requirements explicitly provided by user.
### 2.2 Assumed Requirements
Reasonable assumptions with rationale. Format:
- **Assumption**: [what was assumed]
- **Rationale**: [why this is reasonable]
## 3. Current System Review
Analysis of existing architecture against requirements. Organize by topic area.
## 4. Gaps
Identified issues, risks, or missing capabilities. Prioritize by impact:
- **Critical**: System failures, data loss risks
- **High**: Performance bottlenecks, scalability limits
- **Medium**: Operational inefficiencies, maintainability issues
- **Low**: Nice-to-have improvements
## 5. Recommendations
Actionable improvements with:
- **Problem addressed**: Which gap(s) this solves
- **Recommendation**: Specific technical approach
- **Example**: Concrete implementation guidance
- **Trade-offs**: What you gain vs what you sacrifice
- **Impact**: Expected improvement if implemented
Analysis Checklist
For each relevant topic, evaluate:
Load Balancing
Caching
Databases
CAP & Consistency
Sharding
Replication
Message Queues
Rate Limiting
Authentication & Authorization
Resilience
Monitoring
Common Anti-Patterns to Flag
- No caching strategy: "Just add Redis" without invalidation plan
- Wrong database choice: Forcing SQL for graph data or NoSQL for transactions
- Ignoring partition tolerance: Designing as if network never fails
- Naive sharding: Choosing shard key without considering access patterns
- Synchronous everything: No async processing for non-critical paths
- Alert fatigue: Alerting on every error instead of user impact
- Missing rate limiting: No protection against traffic spikes
- Stateless assumption violations: Session stickiness breaking horizontal scaling
1---2name: system-design-analysis3description: Analyze, review, and provide recommendations for distributed system designs. Use when: (1) Reviewing existing system architectures for gaps or improvements, (2) Analyzing system designs for scalability, reliability, or performance issues, (3) Providing recommendations on load balancing, caching, databases, sharding, replication, messaging, rate limiting, authentication, resilience, or monitoring, (4) Assessing trade-offs in system design decisions, (5) Creating system design review documents with gaps and recommendations. Triggers: "review my system design", "analyze this architecture", "what are the gaps", "system design recommendations", "scalability review", "reliability analysis".4---5
6# System Design Analysis
7
8Analyze distributed system designs for scalability, reliability, performance, and security. Produce structured review documents with gaps and actionable recommendations.
9
10## Core Principle
11
12System design is about trade-offs, not perfect answers. Every recommendation must consider context: access patterns, scale requirements, consistency needs, and operational constraints.
13
14## Workflow
15
16### Phase 1: Information Gathering
17
18Ask focused questions to understand the system. Prioritize these areas:
19
201. **Functional scope**: What does the system do? Core operations?
212. **Scale**: Expected QPS, data volume, user count?
223. **Access patterns**: Read-heavy vs write-heavy? Hot spots?
234. **Consistency requirements**: Strong vs eventual? Where?
245. **Availability targets**: SLA requirements? Acceptable downtime?
256. **Current architecture**: Existing components, databases, services?
267. **Known pain points**: What's broken or struggling today?
27
28Limit to 3-5 questions per message. Make reasonable assumptions when information is missing—document assumptions explicitly.
29
30### Phase 2: Topic Analysis
31
32Based on gathered information, analyze relevant system design topics. Load reference files as needed:
33
34| Topic | Reference File | When to Load |
35|-------|----------------|--------------|
36| Load balancing | [load-balancing.md](references/load-balancing.md) | Traffic distribution, L4/L7 decisions |
37| Caching | [caching.md](references/caching.md) | Latency optimization, read scaling |
38| Databases | [databases.md](references/databases.md) | Data modeling, SQL vs NoSQL choices |
39| CAP & Consistency | [cap-consistency.md](references/cap-consistency.md) | Consistency model decisions |
40| Sharding | [sharding-partitioning.md](references/sharding-partitioning.md) | Write/storage scaling |
41| Replication | [replication.md](references/replication.md) | Availability, read scaling |
42| Message queues | [message-queues.md](references/message-queues.md) | Async processing, decoupling |
43| Rate limiting | [rate-limiting.md](references/rate-limiting.md) | Traffic protection, abuse prevention |
44| Auth | [auth.md](references/auth.md) | Security, identity management |
45| Resilience | [resilience-patterns.md](references/resilience-patterns.md) | Failure handling, fault tolerance |
46| Monitoring | [monitoring-observability.md](references/monitoring-observability.md) | Observability, debugging |
47
48Load only topics relevant to the specific system under review.
49
50### Phase 3: Document Generation
51
52Produce a structured analysis document with these sections:
53
54```
55# System Design Analysis: [System Name]
56
57## 1. Abstract
58Brief summary of the system and analysis scope (2-3 paragraphs).
59
60## 2. Requirements
61
62### 2.1 Stated Requirements
63Requirements explicitly provided by user.
64
65### 2.2 Assumed Requirements
66Reasonable assumptions with rationale. Format:
67- **Assumption**: [what was assumed]
68- **Rationale**: [why this is reasonable]
69
70## 3. Current System Review
71Analysis of existing architecture against requirements. Organize by topic area.
72
73## 4. Gaps
74Identified issues, risks, or missing capabilities. Prioritize by impact:
75- **Critical**: System failures, data loss risks
76- **High**: Performance bottlenecks, scalability limits
77- **Medium**: Operational inefficiencies, maintainability issues
78- **Low**: Nice-to-have improvements
79
80## 5. Recommendations
81Actionable improvements with:
82- **Problem addressed**: Which gap(s) this solves
83- **Recommendation**: Specific technical approach
84- **Example**: Concrete implementation guidance
85- **Trade-offs**: What you gain vs what you sacrifice
86- **Impact**: Expected improvement if implemented
87```
88
89## Analysis Checklist
90
91For each relevant topic, evaluate:
92
93**Load Balancing**
94- [ ] Algorithm appropriate for workload (round robin, least connections, consistent hashing)?
95- [ ] L4 vs L7 appropriate for use case?
96- [ ] LB itself highly available?
97- [ ] Health checks configured?
98
99**Caching**
100- [ ] Cache strategy defined (cache-aside, write-through)?
101- [ ] Eviction policy appropriate (LRU, TTL)?
102- [ ] Cache invalidation strategy?
103- [ ] Hot key and cache stampede handling?
104
105**Databases**
106- [ ] Data model matches access patterns?
107- [ ] Indexes support critical queries?
108- [ ] Read-heavy vs write-heavy considered?
109- [ ] Appropriate SQL vs NoSQL choice?
110
111**CAP & Consistency**
112- [ ] Consistency model matches business requirements?
113- [ ] Trade-offs between C and A explicit?
114- [ ] Read-your-writes where needed?
115
116**Sharding**
117- [ ] Shard key distributes load evenly?
118- [ ] Hot partitions addressed?
119- [ ] Cross-shard operations minimized?
120
121**Replication**
122- [ ] Sync vs async replication appropriate?
123- [ ] Replica lag acceptable?
124- [ ] Leader election mechanism defined?
125- [ ] Split-brain prevention?
126
127**Message Queues**
128- [ ] Delivery guarantees appropriate?
129- [ ] Consumer idempotency?
130- [ ] Dead-letter queue for failures?
131- [ ] Backpressure handling?
132
133**Rate Limiting**
134- [ ] Algorithm chosen (token bucket recommended)?
135- [ ] Limits appropriate for different tiers?
136- [ ] Distributed enforcement for multi-node?
137- [ ] Graceful handling of limit breaches?
138
139**Authentication & Authorization**
140- [ ] AuthN mechanism appropriate (JWT, sessions)?
141- [ ] Token lifecycle managed (expiry, refresh)?
142- [ ] AuthZ model defined (RBAC, ABAC)?
143- [ ] Service-to-service auth?
144
145**Resilience**
146- [ ] Timeouts on all external calls?
147- [ ] Retry strategy with backoff?
148- [ ] Circuit breakers for unstable dependencies?
149- [ ] Graceful degradation paths?
150
151**Monitoring**
152- [ ] Golden signals tracked (latency, traffic, errors, saturation)?
153- [ ] Distributed tracing for request flows?
154- [ ] Structured logging?
155- [ ] Alerts tied to SLOs, not raw metrics?
156
157## Common Anti-Patterns to Flag
158
159- **No caching strategy**: "Just add Redis" without invalidation plan
160- **Wrong database choice**: Forcing SQL for graph data or NoSQL for transactions
161- **Ignoring partition tolerance**: Designing as if network never fails
162- **Naive sharding**: Choosing shard key without considering access patterns
163- **Synchronous everything**: No async processing for non-critical paths
164- **Alert fatigue**: Alerting on every error instead of user impact
165- **Missing rate limiting**: No protection against traffic spikes
166- **Stateless assumption violations**: Session stickiness breaking horizontal scaling