Loading...
Loading...
Compare original and translation side by side
| Factor | Monolith | Modular Monolith | Microservices | Serverless |
|---|---|---|---|---|
| Team size < 10 | Preferred | Strong fit | Overkill | Good for bursty |
| Team size > 30 | Challenging | Good | Preferred | Depends |
| Domain well-understood | Good fit | Good fit | Not needed yet | Good fit |
| Domain evolving rapidly | Fine to start | Good fit | Too early | Good fit |
| Need independent deployment | Not possible | Limited | Key benefit | Built-in |
| Operational maturity low | Good fit | Good fit | High risk | Managed risk |
| Variable/bursty load | Over-provisioned | Over-provisioned | Possible | Strong fit |
| 评估因素 | 单体架构 | 模块化单体 | 微服务 | Serverless |
|---|---|---|---|---|
| 团队规模 < 10 | 首选 | 非常适配 | 过度设计 | 适合突发负载场景 |
| 团队规模 > 30 | 实施难度高 | 适配 | 首选 | 视场景而定 |
| 领域已非常清晰 | 适配 | 适配 | 暂不需要 | 适配 |
| 领域快速迭代 | 适合起步 | 非常适配 | 为时过早 | 适配 |
| 需要独立部署 | 不支持 | 有限支持 | 核心优势 | 原生支持 |
| 运维成熟度低 | 适配 | 适配 | 高风险 | 风险可控 |
| 负载可变/突发 | 资源过度供给 | 资源过度供给 | 可适配 | 非常适配 |
| Improving | May Degrade |
|---|---|
| Consistency | Availability, Latency |
| Performance | Maintainability, Cost |
| Security | Usability, Performance |
| Scalability | Simplicity, Cost |
| Flexibility | Performance, Complexity |
| Time to Market | Quality, Scalability |
| 提升项 | 可能劣化项 |
|---|---|
| 一致性 | 可用性、延迟 |
| 性能 | 可维护性、成本 |
| 安全性 | 易用性、性能 |
| 可扩展性 | 简洁性、成本 |
| 灵活性 | 性能、复杂度 |
| 上线速度 | 质量、可扩展性 |
Weight each quality attribute (1-5), score each option (1-5), multiply and sum.
| Quality Attribute | Weight | Option A | Option B | Option C |
|--------------------|--------|----------|----------|----------|
| Performance | 4 | 4 (16) | 3 (12) | 5 (20) |
| Maintainability | 5 | 5 (25) | 4 (20) | 2 (10) |
| Scalability | 3 | 3 (9) | 5 (15) | 4 (12) |
| Cost | 4 | 4 (16) | 2 (8) | 3 (12) |
| Total | | 66 | 55 | 54 |Weight each quality attribute (1-5), score each option (1-5), multiply and sum.
| Quality Attribute | Weight | Option A | Option B | Option C |
|--------------------|--------|----------|----------|----------|
| Performance | 4 | 4 (16) | 3 (12) | 5 (20) |
| Maintainability | 5 | 5 (25) | 4 (20) | 2 (10) |
| Scalability | 3 | 3 (9) | 5 (15) | 4 (12) |
| Cost | 4 | 4 (16) | 2 (8) | 3 (12) |
| Total | | 66 | 55 | 54 |undefinedundefined| Option | Pros | Cons | Verdict |
|---|---|---|---|
| Option A | ... | ... | Chosen |
| Option B | ... | ... | Rejected because... |
undefined| Option | Pros | Cons | Verdict |
|---|---|---|---|
| Option A | ... | ... | Chosen |
| Option B | ... | ... | Rejected because... |
undefined| Level | Shows | When to Use |
|---|---|---|
| Level 1: System Context | Users and external systems | Always |
| Level 2: Container | Major technical building blocks | Always |
| Level 3: Component | Components within containers | Complex services |
| Level 4: Code | Class-level detail | Critical/complex areas only |
| 层级 | 展示内容 | 使用场景 |
|---|---|---|
| 层级1:系统上下文 | 用户和外部系统 | 所有场景 |
| 层级2:容器 | 核心技术构建块 | 所有场景 |
| 层级3:组件 | 容器内部的组件 | 复杂服务场景 |
| 层级4:代码 | 类级别细节 | 仅关键/复杂模块 |
| Pattern | Use When | Implementation |
|---|---|---|
| Load Balancing | Multiple instances of same service | Round-robin, least connections, IP hash |
| Stateless Services | Need to add/remove instances freely | JWT/external session store |
| Auto-scaling | Variable load patterns | CPU/memory/request-rate triggers |
| Read Replicas | Read-heavy workloads | Route reads to replicas, writes to primary |
| 模式 | 使用场景 | 实现方式 |
|---|---|---|
| 负载均衡 | 同一服务运行多个实例 | 轮询、最少连接、IP哈希 |
| 无状态服务 | 需要自由增减实例 | JWT/外置会话存储 |
| 自动扩缩容 | 负载模式可变 | CPU/内存/请求速率触发 |
| 只读副本 | 读密集型工作负载 | 读请求路由到副本,写请求走主库 |
| Strategy | How | Good For |
|---|---|---|
| Hash-based | Consistent hash of key | Even distribution |
| Range-based | Date range, ID range | Time-series data |
| Geographic | By region/country | Data locality |
| Tenant-based | Per customer | Multi-tenant SaaS |
| 策略 | 实现方式 | 适用场景 |
|---|---|---|
| 哈希分片 | 键的一致性哈希 | 均匀分布需求 |
| 范围分片 | 日期范围、ID范围 | 时间序列数据 |
| 地理分片 | 按地区/国家划分 | 数据就近访问需求 |
| 租户分片 | 按客户划分 | 多租户SaaS |
Client Cache (browser) -> CDN Cache -> API Gateway Cache ->
Application Cache (Redis) -> Database Query Cache -> DatabaseClient Cache (browser) -> CDN Cache -> API Gateway Cache ->
Application Cache (Redis) -> Database Query Cache -> Databaseundefinedundefinedundefinedundefined| Term | Definition | Example |
|---|---|---|
| SLI | Measurable metric | Request latency, error rate |
| SLO | Target value | 99.9% availability |
| SLA | Contractual commitment | 99.5% with penalty clause |
| Error Budget | 1 - SLO | 0.1% = 8.76h/year |
| 术语 | 定义 | 示例 |
|---|---|---|
| SLI | 可衡量指标 | 请求延迟、错误率 |
| SLO | 目标值 | 99.9%可用性 |
| SLA | 合同承诺 | 99.5%可用性附带惩罚条款 |
| 错误预算 | 1 - SLO | 0.1% = 每年8.76小时容错时间 |
| Anti-Pattern | Why It Is Wrong | Correct Approach |
|---|---|---|
| Resume-driven architecture | Complexity without benefit | Choose simplest solution that works |
| Distributed monolith | All downsides of both | Either true monolith or true microservices |
| Premature optimization | Scaling for 1M users with 100 | Design for current + 10x, not 1000x |
| Golden hammer | One technology for everything | Right tool for each problem |
| Architecture without validation | Untested assumptions | Load test, failure test, validate |
| Big upfront design without iteration | Requirements change | Evolutionary architecture with guardrails |
| Vague NFRs ("fast", "scalable") | Cannot be validated | Quantified targets with measurement |
| 反模式 | 问题点 | 正确做法 |
|---|---|---|
| 简历驱动架构 | 无意义的复杂度提升 | 选择能满足需求的最简单方案 |
| 分布式单体 | 同时具备两种架构的所有缺点 | 要么做真正的单体,要么做真正的微服务 |
| 过早优化 | 只有100个用户就为100万用户做扩容 | 设计支撑当前+10倍规模即可,不需要考虑1000倍 |
| golden hammer | 所有问题都用同一个技术解决 | 为每个问题选择最合适的工具 |
| 未经验证的架构 | 全是未测试的假设 | 做压测、故障测试、验证设计 |
| 一次性的大规模前置设计无迭代 | 需求会发生变化 | 带护栏的演进式架构 |
| 模糊的非功能需求("快"、"可扩展") | 无法验证 | 带衡量方式的量化目标 |
| Task Pattern | Dispatch To | When |
|---|---|---|
| Analyzing different architecture layers | | When reviewing frontend, backend, and infra independently |
| Security assessment of architecture | | When architecture involves auth, data flow, or external APIs |
| Performance implications analysis | | When architecture decisions affect latency or throughput |
| Code quality review of existing patterns | | When evaluating current codebase for refactoring |
dispatching-parallel-agents| 任务模式 | 调度目标 | 触发时机 |
|---|---|---|
| 分析不同架构层 | | 需要独立审核前端、后端和基础设施时 |
| 架构安全评估 | | 架构涉及认证、数据流或外部API时 |
| 性能影响分析 | | 架构决策会影响延迟或吞吐量时 |
| 现有模式代码质量审核 | | 评估现有代码库重构需求时 |
dispatching-parallel-agents| Skill | Relationship |
|---|---|
| Backend implementation follows architecture decisions |
| Full-stack architecture follows service boundaries |
| Security is a cross-cutting architectural concern |
| Performance NFRs drive optimization targets |
| Architecture decisions inform implementation planning |
| Review validates architectural consistency |
| NFRs become acceptance criteria |
| 技能 | 关联关系 |
|---|---|
| 后端实现遵循架构决策 |
| 全栈架构遵循服务边界定义 |
| 安全是架构的横切关注点 |
| 性能非功能需求驱动优化目标 |
| 架构决策为实现规划提供输入 |
| 审核验证架构一致性 |
| 非功能需求成为验收标准 |