‹ 首页

microservices-patterns

@tranhieutt · 收录于 1 周前

Provides microservices design patterns for service decomposition, API gateway, circuit breakers, saga orchestration, and inter-service communication. Use when designing or implementing microservices architecture.

适合你,如果你正在设计或实现微服务系统

/ 下载安装
microservices-patterns.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add tranhieutt/software_development_department/microservices-patterns
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- tranhieutt/software_development_department/microservices-patterns
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify tranhieutt/software_development_department/microservices-patterns
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
68GitHub stars
~514最小装载
~514含声明引用
~3.3K文本包总量
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · e5ba809

Microservices Patterns

Service decomposition, communication, resilience, and orchestration patterns.

Service Decomposition

| Pattern | Description | Use When | |---------|-------------|----------| | Domain-Driven | Align services with bounded contexts | Complex business domains | | Data-Ownership | Service owns its data store | Data isolation required | | Team-Aligned | One service per team | Large organizations |

Communication Patterns
Sync: HTTP/gRPC

\\\`yaml

API Gateway routing

routes:

  • match: { prefix: /orders } route: { cluster: order-service }
  • match: { prefix: /users } route: { cluster: user-service }

\\\`

Async: Message Queue

\\\ Producer → Exchange → Queue → Consumer (Topic) (DLQ on failure) \\\

Use async for: event propagation, eventual consistency, load leveling.

Resilience Patterns
Circuit Breaker

\\\typescript // Example with opossum const breaker = new CircuitBreaker(fetchUserProfile, { timeout: 3000, errorThresholdPercentage: 50, resetTimeout: 30000, }); \\\

Retry with Backoff

\\\typescript async function retryWithBackoff(fn, maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { return await fn(); } catch (e) { await sleep(Math.pow(2, i) * 1000); } } throw new Error('Max retries exceeded'); } \\\

Data Patterns

| Pattern | Consistency | Complexity | Use When | |---------|-------------|------------|----------| | Saga (orchestration) | Eventual | High | Complex multi-service transactions | | Saga (choreography) | Eventual | Medium | Simple event chains | | Event sourcing | Eventual | High | Audit trail, time travel | | Shared database | Strong | Low | Anti-pattern, avoid |

API Gateway

Tools: Kong, AWS API Gateway, Envoy, NGINX.

Responsibilities: routing, auth, rate limiting, request transformation, load balancing.

Observability Stack
  • Distributed tracing: Jaeger / Tempo
  • Metrics: Prometheus + Grafana
  • Logs: ELK / Loki
  • Service mesh: Istio / Linkerd (adds mTLS, traffic management)
Related Skills
  • backend-architect — single-service architecture
  • event-sourcing-architect — event sourcing patterns
  • kubernetes-architect — deployment patterns
  • deployment-engineer — CI/CD for microservices
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。