architect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

System Architecture

系统架构

Design scalable, maintainable system architectures.
设计可扩展、可维护的系统架构。

When to Use

适用场景

  • Major architectural decisions
  • System design discussions
  • Evaluating trade-offs
  • Planning large refactors
  • Reviewing system structure
  • 重大架构决策
  • 系统设计讨论
  • 权衡方案评估
  • 大型重构规划
  • 系统结构评审

Design Process

设计流程

  1. Understand - Clarify requirements and constraints
  2. Identify - Define components and boundaries
  3. Design - Create architecture with trade-offs
  4. Validate - Check against requirements
  5. Document - Record decisions and rationale
  1. 理解 - 明确需求与约束条件
  2. 识别 - 定义组件与边界
  3. 设计 - 制定包含权衡方案的架构
  4. 验证 - 对照需求进行检查
  5. 文档化 - 记录决策与理由

Architecture Patterns

架构模式

Layered Architecture

分层架构

┌─────────────────────────────┐
│      Presentation Layer     │  UI, API endpoints
├─────────────────────────────┤
│       Business Layer        │  Domain logic, services
├─────────────────────────────┤
│      Persistence Layer      │  Repositories, DAOs
├─────────────────────────────┤
│        Data Layer           │  Database, cache
└─────────────────────────────┘
┌─────────────────────────────┐
│      Presentation Layer     │  UI, API endpoints
├─────────────────────────────┤
│       Business Layer        │  Domain logic, services
├─────────────────────────────┤
│      Persistence Layer      │  Repositories, DAOs
├─────────────────────────────┤
│        Data Layer           │  Database, cache
└─────────────────────────────┘

Microservices

微服务

┌─────────┐  ┌─────────┐  ┌─────────┐
│ User    │  │ Order   │  │ Payment │
│ Service │  │ Service │  │ Service │
└────┬────┘  └────┬────┘  └────┬────┘
     │            │            │
     └────────────┼────────────┘
           ┌──────┴──────┐
           │ Message Bus │
           └─────────────┘
┌─────────┐  ┌─────────┐  ┌─────────┐
│ User    │  │ Order   │  │ Payment │
│ Service │  │ Service │  │ Service │
└────┬────┘  └────┬────┘  └────┬────┘
     │            │            │
     └────────────┼────────────┘
           ┌──────┴──────┐
           │ Message Bus │
           └─────────────┘

Event-Driven

事件驱动

Producer → Event Bus → Consumer(s)
              ├→ Service A
              ├→ Service B
              └→ Analytics
Producer → Event Bus → Consumer(s)
              ├→ Service A
              ├→ Service B
              └→ Analytics

Decision Framework

决策框架

Trade-off Analysis

权衡分析

AspectOption AOption B
ComplexityLowHigh
ScalabilityLimitedHorizontal
Cost$$$$
Time to marketFastSlow
MaintenanceEasyComplex
方面方案A方案B
复杂度
可扩展性有限水平扩展
成本$$$$
上市时间
维护难度简单复杂

ADR Template

ADR模板

markdown
undefined
markdown
undefined

ADR-001: [Decision Title]

ADR-001: [Decision Title]

Status

Status

Accepted | Proposed | Deprecated
Accepted | Proposed | Deprecated

Context

Context

[Why we need to make this decision]
[Why we need to make this decision]

Decision

Decision

[What we decided]
[What we decided]

Consequences

Consequences

Positive

Positive

  • [Benefit 1]
  • [Benefit 1]

Negative

Negative

  • [Trade-off 1]
  • [Trade-off 1]

Risks

Risks

  • [Risk 1]
undefined
  • [Risk 1]
undefined

Key Principles

核心原则

  • Separation of Concerns - Each component has one responsibility
  • Loose Coupling - Minimize dependencies between components
  • High Cohesion - Related functionality grouped together
  • YAGNI - Don't build for hypothetical requirements
  • Fail Fast - Detect and report errors immediately
  • 关注点分离 - 每个组件仅承担单一职责
  • 松耦合 - 最小化组件间的依赖
  • 高内聚 - 相关功能集中在一起
  • YAGNI - 不为假设性需求构建功能
  • 快速失败 - 立即检测并报告错误

Scalability Checklist

可扩展性检查清单

  • Stateless services (session in Redis/DB)
  • Horizontal scaling capability
  • Database read replicas
  • Caching layer (Redis, CDN)
  • Async processing for heavy tasks
  • Rate limiting and circuit breakers
  • 无状态服务(会话存储于Redis/DB)
  • 水平扩展能力
  • 数据库只读副本
  • 缓存层(Redis、CDN)
  • 重任务异步处理
  • 限流与断路器

Examples

示例

Input: "Design a notification system" Action: Define channels, queue architecture, delivery guarantees, scaling strategy
Input: "Should we use microservices?" Action: Analyze team size, complexity, scaling needs, recommend with trade-offs
输入: "设计一个通知系统" 操作: 定义渠道、队列架构、交付保障、扩展策略
输入: "我们应该使用微服务吗?" 操作: 分析团队规模、复杂度、扩展需求,给出包含权衡方案的建议