system-design
2
总安装量
2
周安装量
#64879
全站排名
安装命令
npx skills add https://github.com/spjoshis/claude-code-plugins --skill system-design
Agent 安装分布
opencode
2
claude-code
2
github-copilot
2
codex
2
kimi-cli
2
gemini-cli
2
Skill 文档
System Design
Design robust, scalable systems using proven architecture patterns and best practices for enterprise applications.
When to Use This Skill
- New system design
- Architecture refactoring
- Scaling existing systems
- Technology modernization
- Integration planning
- Performance optimization
- Architecture reviews
- Technical interviews
Core Concepts
1. C4 Model Architecture Diagram
## Level 1: System Context
[Users] â [E-Commerce System] â [Payment Gateway]
â
[Email Service]
## Level 2: Container Diagram
E-Commerce System:
- Web Application (React, Node.js)
- API Server (Node.js, Express)
- Database (PostgreSQL)
- Cache (Redis)
- Message Queue (RabbitMQ)
- Search Engine (Elasticsearch)
## Level 3: Component Diagram (API Server)
API Server:
- Authentication Service
- Product Catalog Service
- Order Management Service
- Payment Service
- Notification Service
## Level 4: Code (Authentication Service)
Classes:
- AuthController
- AuthService
- TokenManager
- UserRepository
2. Capacity Planning
## System Capacity Planning
**Requirements:**
- 1M active users
- Peak: 10K concurrent users
- 100K transactions/day
- 3 second max response time
- 99.9% uptime
**Calculations:**
**Traffic:**
- Requests/sec (peak): 10K users à 10 req/min / 60 = 1,667 RPS
- Database queries: 1,667 Ã 3 avg queries = 5,000 QPS
- Storage/day: 100K Ã 5KB avg = 500MB/day
- Storage/year: 500MB Ã 365 = 180GB
**Server Capacity:**
- App servers: 1,667 RPS / 200 RPS per server = 9 servers
- With redundancy (3x): 27 servers
- Database: Master-replica setup, read replicas for queries
**Network:**
- Bandwidth: 1,667 req à 50KB avg = 83MB/s = 664 Mbps
- CDN for static assets
**Costs (AWS estimate):**
- EC2 (27 Ã c5.xlarge): $3,500/month
- RDS (db.r5.2xlarge): $1,200/month
- Load Balancer: $200/month
- CloudFront CDN: $500/month
- Total: ~$5,400/month
3. Trade-Off Analysis
## Architecture Decision: Monolith vs Microservices
**Monolith:**
â
Pros:
- Simpler deployment
- Easier local development
- Single codebase
- Simpler testing
- Lower operational overhead
â Cons:
- Scaling all-or-nothing
- Technology lock-in
- Longer deployment cycles
- Harder to maintain at scale
**Microservices:**
â
Pros:
- Independent scaling
- Technology flexibility
- Team autonomy
- Fault isolation
- Faster deployments
â Cons:
- Complex infrastructure
- Distributed system challenges
- Network latency
- Data consistency
- Higher operational overhead
**Decision:** Start with modular monolith, extract microservices as needed
**Rationale:** Team size (5 devs), early stage, faster time-to-market
Best Practices
- Understand requirements – Functional and non-functional
- Start simple – YAGNI (You Aren’t Gonna Need It)
- Design for failure – Assume components will fail
- Think in layers – Presentation, business, data
- Loose coupling – Minimize dependencies
- High cohesion – Related functionality together
- Document decisions – ADRs (Architecture Decision Records)
- Iterate and evolve – Continuous improvement
Resources
- Designing Data-Intensive Applications: Martin Kleppmann
- System Design Interview: Alex Xu
- C4 Model: https://c4model.com