跳到正文
Skillpedia
API 与服务器(后端)41k · #6639

microservices-patterns

它能做什么

这个工具可以帮你规划和构建被拆分成多个小部件(微服务)的复杂软件系统。它会讲解这些部件之间应如何通信、如何管理数据,以及如何从故障中恢复。

适用场景

  • ✓把一个大型程序拆分成多个小部件时。
  • ✓设计系统各部分之间如何相互通信时。
  • ✓想让系统更能抵御故障时。

技能链接

https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/microservices-patterns/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/microservices-patterns/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我怎样把一个在线商店应用拆分成微服务?”

每周 5 个新技能,1 分钟读完。

工作原理

工具会结合微服务设计模式的示例和讲解,展示如何划分各个部件、它们如何交换信息,以及如何处理各类问题。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Microservices Patterns

Master microservices architecture patterns including service boundaries, inter-service communication, data management, and resilience patterns for building distributed systems.

When to Use This Skill

  • Decomposing monoliths into microservices
  • Designing service boundaries and contracts
  • Implementing inter-service communication
  • Managing distributed data and transactions
  • Building resilient distributed systems
  • Implementing service discovery and load balancing
  • Designing event-driven architectures

Core Concepts

1. Service Decomposition Strategies

By Business Capability

  • Organize services around business functions
  • Each service owns its domain
  • Example: OrderService, PaymentService, InventoryService

By Subdomain (DDD)

  • Core domain, supporting subdomains
  • Bounded contexts map to services
  • Clear ownership and responsibility

Strangler Fig Pattern

  • Gradually extract from monolith
  • New functionality as microservices
  • Proxy routes to old/new systems

2. Communication Patterns

Synchronous (Request/Response)

  • REST APIs
  • gRPC
  • GraphQL

Asynchronous (Events/Messages)

  • Event streaming (Kafka)
  • Message queues (RabbitMQ, SQS)
  • Pub/Sub patterns

3. Data Management

Database Per Service

  • Each service owns its data
  • No shared databases
  • Loose coupling

Saga Pattern

  • Distributed transactions
  • Compensating actions
  • Eventual consistency

4. Resilience Patterns

Circuit Breaker

  • Fail fast on repeated errors
  • Prevent cascade failures

Retry with Backoff

  • Transient fault handling
  • Exponential backoff

Bulkhead

  • Isolate resources
  • Limit impact of failures

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

常见问题

什么是微服务?

微服务是较大软件中相互独立的小部件,每个都负责特定的功能。

什么是“异步通信”?

指软件部件之间互相发送消息,但不需要立即等待回复,就像发一封电子邮件。

什么是 'Circuit Breaker' 模式?

这是一种技术,用来防止系统某一部分的故障引发其他部分连锁崩溃。

详情

作者的原始描述

Design microservices architectures with service boundaries, event-driven communication, and resilience patterns. Use when building distributed systems, decomposing monoliths, or implementing microservices.

repo: wshobson/agents

热度

GitHub 星标
41k
排名
#6639
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能