本文由 AI 分析生成
建立時間: 2026-03-27 來源: https://microservices.io/patterns/index.html
Summary
Chris Richardson’s canonical microservices pattern catalog — a living reference covering ~65+ patterns organized by problem domain: architectural style, service decomposition, service collaboration, transactional messaging, testing, deployment, cross-cutting concerns, observability, and UI. Each pattern links to a detailed description, forces/tradeoffs, and related patterns. The definitive reference for microservices architecture decisions.
Chris Richardson 的微服務模式目錄——涵蓋 ~65+ 個模式,按問題域組織:架構風格、服務分解、服務協作、事務性消息、測試、部署、橫切關注點、可觀察性和 UI。每個模式都連結到詳細描述、權衡和相關模式。微服務架構決策的權威參考。
Key Points
- Service decomposition: Decompose by Business Capability (aligned with org structure) vs. Decompose by DDD Subdomain — the choice determines coupling patterns for years
- Data patterns: Database per Service (the microservices default) vs. Shared Database (pragmatic but couples services) — forces tradeoffs in CQRS, Saga, API Composition
- Saga pattern: sequences of local transactions with compensating transactions to maintain distributed consistency — replaces distributed transactions (2PC)
- CQRS: separate read and write models — solves the query-across-services problem that Database-per-Service creates
- Deployment taxonomy: container per service → service mesh → serverless deployment — abstractions at increasing levels
- Observability triad: health check API + log aggregation + distributed tracing — three separate patterns, each required for production-grade operations
Insights
The most important pattern relationship: Database-per-Service is almost mandatory for true microservices autonomy, but it creates a query problem (you can’t do a JOIN across service boundaries). CQRS + Event Sourcing is the canonical solution, but it comes with significant complexity. Understanding this coupling before choosing Database-per-Service is essential — many teams adopt it for autonomy benefits without understanding the query tax they’re committing to.
The Saga pattern is the hardest to implement correctly: compensating transactions must be designed upfront, and the choreography vs. orchestration choice matters enormously for debugging when things go wrong.
Connections
Raw Excerpt
Each service has its own private database (Database per Service) — key to ensuring loose coupling. Queries that span multiple services solved via API Composition or CQRS with materialized views.