microservices

GitHub

提供微服务架构的设计与运维指南,涵盖领域边界划分、通信模式选择、CQRS实践及分布式追踪方案。

categories/backend/microservices/SKILL.md cosmicstack-labs/mercury-agent-skills

Trigger Scenarios

设计微服务架构 解决服务间通信问题 配置分布式追踪

Install

npx skills add cosmicstack-labs/mercury-agent-skills --skill microservices -g -y
More Options

Non-standard path

npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/categories/backend/microservices -g -y

Use without installing

npx skills use cosmicstack-labs/mercury-agent-skills@microservices

指定 Agent (Claude Code)

npx skills add cosmicstack-labs/mercury-agent-skills --skill microservices -a claude-code -g -y

安装 repo 全部 skill

npx skills add cosmicstack-labs/mercury-agent-skills --all -g -y

预览 repo 内 skill

npx skills add cosmicstack-labs/mercury-agent-skills --list

SKILL.md

Frontmatter
{
    "name": "microservices",
    "metadata": {
        "tags": [
            "microservices",
            "architecture",
            "distributed-systems",
            "event-sourcing",
            "cqrs"
        ],
        "author": "cosmicstack-labs",
        "version": "1.0.0",
        "category": "backend"
    },
    "description": "Service boundaries, communication patterns, event sourcing, CQRS, and distributed tracing"
}

Microservices

Design and operate microservice architectures.

Service Boundaries

Bounded Context (DDD)

  • Each service owns a domain concept
  • Service has its own database (no DB sharing)
  • Communication via API or events
  • Avoid "shared" services (leads to tight coupling)

Service Sizing

  • Too small: Nano-services — high overhead, hard to debug
  • Too large: Distributed monolith — worst of both worlds
  • Right size: Team can build, test, deploy independently

Communication Patterns

Pattern Type When
REST Sync Request-response, CRUD
gRPC Sync (fast) Internal, high throughput
Event Async Decoupled workflows
Message Queue Async Buffered, reliable delivery

Event-Driven Communication

Service A → Event Bus → Service B
                       → Service C
                       → Service D

Benefits: eventual consistency, loose coupling, replayability.

CQRS (Command Query Responsibility Segregation)

  • Separate read and write models
  • Queries go to optimized read stores (materialized views)
  • Commands go to write stores (normalized)
  • Eventually consistent between them

Distributed Tracing

  • Correlation ID passed across all services
  • Use OpenTelemetry for instrumentation
  • Trace each request: Service → Queue → DB → External API
  • Visualize in Jaeger or Zipkin
  • Alert on traces that exceed latency SLOs

Anti-Patterns to Avoid

❌ Shared database between services ❌ Sync chains (A → B → C → D blocking) ❌ Distributed monolith (microservices but deployed together) ❌ Absent monitoring ("it works in dev") ❌ Premature decomposition (start monolith, extract carefully)

Version History

  • 38e2523 Current 2026-07-05 19:36

Same Skill Collection

categories/ai-ml/agent-audit-logging/SKILL.md
categories/ai-ml/agent-handoff-protocols/SKILL.md
categories/ai-ml/agent-health-monitoring/SKILL.md
categories/ai-ml/agent-task-delegation/SKILL.md
categories/ai-ml/ai-agent-design/SKILL.md
categories/ai-ml/error-recovery-retry/SKILL.md
categories/ai-ml/memory-management/SKILL.md
categories/ai-ml/prompt-engineering/SKILL.md
categories/ai-ml/prompt-version-management/SKILL.md
categories/ai-ml/routerbase-model-gateway/SKILL.md
categories/ai-ml/token-budget-tracking/SKILL.md
categories/automation/daily-briefing/SKILL.md
categories/automation/screenshot/SKILL.md
categories/automation/shell-scripting/SKILL.md
categories/automation/twitter-account-manager/SKILL.md
categories/automation/workflow-automation/SKILL.md
categories/automation/x-twitter-automation/SKILL.md
categories/backend/api-design/SKILL.md
categories/backend/authentication-authorization/SKILL.md
categories/backend/caching-strategies/SKILL.md
categories/backend/database-design/SKILL.md
categories/backend/message-queues/SKILL.md
categories/backend/nodejs-patterns/SKILL.md
categories/backend/python-patterns/SKILL.md
categories/backend/serverless-patterns/SKILL.md
categories/business/event-staffing-compliance/SKILL.md
categories/business/event-staffing-ordering/SKILL.md
categories/business/negotiation/SKILL.md
categories/business/startup-strategy/SKILL.md
categories/career/career-planning/SKILL.md
categories/career/interview-prep/SKILL.md
categories/career/linkedin-optimization/SKILL.md
categories/career/resume-writing/SKILL.md
categories/career/salary-negotiation/SKILL.md
categories/creative-personal-development/content-repurposer/SKILL.md
categories/creative-personal-development/daily-standup-journal/SKILL.md
categories/creative-personal-development/decision-matrix/SKILL.md
categories/creative-personal-development/idea-validator/SKILL.md
categories/creative-personal-development/meeting-note-summarizer/SKILL.md
categories/creative-personal-development/personal-branding-statement/SKILL.md
categories/creative-personal-development/storytelling-advisor/SKILL.md
categories/creative-personal-development/time-blocking-scheduler/SKILL.md
categories/data/data-pipeline/SKILL.md
categories/design/accessibility/SKILL.md
categories/design/ui-design-system/SKILL.md
categories/development/api-documentation/SKILL.md
categories/development/architecture-decision-records/SKILL.md
categories/development/clean-code/SKILL.md
categories/development/code-review/SKILL.md

Metadata

Files
0
Version
4c57cf2
Hash
f299dbed
Indexed
2026-07-05 19:36

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 02:20
浙ICP备14020137号-1 $방문자$