yonatankarp/software-design-skills

arch-microservices

Use when designing or reviewing a microservices architecture — phrases like "microservices", "should we split this service", "service boundaries", "bounded context per service", "API gateway", "backend for frontend", "BFF", "service mesh", "microservices vs…

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/yonatankarp/software-design-skills --skill arch-microservices

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

One-line summary

Decompose the system into independently deployable services, each owning its data and aligned with a business capability. Communicate over the network. Pay the operational tax in exchange for autonomy and independent scaling.

When to use this skill

  • Multiple teams stepping on each other in a single codebase / deployment.
  • Different parts of the system need independent scaling characteristics (one is CPU-bound, another I/O-bound, a third bursty).
  • Different parts have different release cadences and one team's deploy must not block another's.
  • Different parts have different reliability profiles (a critical payment path; a non-critical analytics dashboard).

When NOT to use this skill

  • One team, one product, no scaling pressure — you don't have the problems microservices solve. Keep the monolith.
  • Domain not understood well enough to draw service boundaries — premature splits are very expensive to reverse.
  • No operational maturity (no CI/CD, no observability, no on-call) — microservices amplify operational pain.
  • Resume-driven development. Stop.

Core content

Service boundaries follow business capabilities, not technical layers. A customer-service, orders-service, pricing-service is correct. A database-service, api-service, cache-service is anti-pattern. Boundaries are typically aligned with DDD bounded contexts (see ddd-bounded-context).

Each service owns its data. No shared database. If service B needs data from service A, B either calls A's API or A publishes events that B subscribes to. Sharing a database underneath two "microservices" makes them a distributed monolith — the worst of both worlds.

Communication patterns.

  • Synchronous (REST, gRPC). Direct, easy to reason about, latency-coupled. Use for query-heavy patterns where the caller needs an immediate answer.
  • Asynchronous (events, see `arch-event-driven`). Decoupled in time, eventually consistent. Use for workflows that span services.

Most production systems mix both.

Edge patterns.

  • API gateway — single entry point for external clients; handles auth, rate-limiting, routing, response composition. Decouples clients from internal service topology.
  • Backend for Frontend (BFF) — a gateway tailored per client type (mobile, web, partner API). Avoids the "one gateway must satisfy every client" trap.
  • Service mesh (Istio, Linkerd) — sidecar proxies handling traffic, mTLS, retries, observability. Moves cross-cutting infrastructure out of services. Justified at scale; overkill below ~10 services.

Anti-pattern alert: distributed monolith. Services deployed independently but coupled tightly (shared database, synchronous chains, lock-step releases). Carries all the operational cost of microservices with none of the autonomy benefit. Hardest to escape.

Decision heuristics

  • Default to monolith. Microservices solve specific problems (team autonomy, independent scaling, fault isolation). If you don't have those problems, you don't need this style.
  • Service boundaries align with bounded contexts. Use ddd-bounded-context first; let the contexts inform the splits, not the other way around.
  • A service that owns no data of its own is a smell — usually it's an adapter or a coordinator that should live elsewhere.
  • Synchronous chains of more than 2-3 services for a single user request indicate broken decomposition. Reach for events or rethink the boundary.
  • BFF when client types diverge significantly; gateway with content negotiation when they don't.

Anti-patterns

  • Distributed monolith. Services that must release together. Worst of both worlds.
  • Nanoservices. Services so small they ship per-class. Coordination cost exceeds any decomposition benefit.
  • Shared database. Two services reading and writing the same tables — they're not separate.
  • Synchronous chains. Service A calls B calls C calls D for one user request. Each adds latency and failure surface; the chain fails when any link does.
  • Choosing microservices because Netflix does — Netflix solved Netflix's problems; your problems are different.

See also

  • ddd-bounded-context — service boundaries should follow bounded contexts.
  • arch-event-driven — the standard async communication style.
  • arch-saga — coordinating distributed transactions.
  • arch-circuit-breaker — failure isolation between services.
  • arch-strangler-fig — migrating from monolith to microservices.

References

  • Richards & Ford, Fundamentals of Software Architecture, Ch. 17 (Microservices).
  • Sam Newman, Building Microservices (O'Reilly).
  • Sam Newman, Monolith to Microservices (O'Reilly).
  • Khononov, Learning DDD, Ch. 14 (Microservices).

タスクに関連する項目

同じリポジトリから

関連する Skills

すべての Skills
yonatankarp
コミュニティ

arch-adr

Use when recording an architectural decision so future maintainers know why — phrases like "ADR", "architecture decision record", "why did we pick X", "lightweight architecture documentation", "decision log", "should this be an ADR", "tribal knowledge", "we chose this two years ago and now nobody remembers why". Defines the ADR as a short, structured document capturing what was decided, why, alternatives considered, and consequences — written at the time of the decision and kept in the repo.

導入数
2
GitHub Stars
1
更新日
5月19日
yonatankarp
コミュニティ

arch-fitness-functions

Use when enforcing architectural characteristics through automation — phrases like "architecture fitness function", "evolutionary architecture", "architecture tests", "ArchUnit", "dependency rules in CI", "automated architecture checks", "guardrails", "drift detection". Defines fitness functions as automated checks that verify architectural characteristics on every change, catching drift before it accumulates.

導入数
2
GitHub Stars
1
更新日
5月19日
yonatankarp
コミュニティ

arch-strangler-fig

Use when migrating a legacy system incrementally — phrases like "strangler fig", "strangler pattern", "incremental migration", "monolith to microservices", "rewrite without big bang", "replace legacy in place", "facade in front of the legacy system", "anticorruption layer". Defines Fowler's Strangler Fig as the migration discipline of gradually replacing legacy functionality behind a stable facade, never doing a big-bang rewrite.

導入数
2
GitHub Stars
1
更新日
5月19日
yonatankarp
コミュニティ

ddd-aggregate

Use when designing or critiquing aggregate boundaries — phrases like "aggregate", "aggregate root", "should these be one entity or two", "consistency boundary", "transactional consistency", "this aggregate is huge", "should I reference by ID or by object". Defines aggregates as transactional consistency boundaries and the rules for entity references within and across them.

導入数
2
GitHub Stars
1
更新日
5月19日