360 Secure SkillHub
360 安全技能中心

architecture-paradigm-service-based

该 Skill 提供基于服务(service-based)架构范式的知识型指导,说明何时采用与不采用、五步采用流程、关键交付物(ADR、契约测试、Runbook)以及共享数据库耦合与架构退化的风险缓解措施,并列出 api-gateway、service-registry 等术语。仅输出方法论文本,不含代码或工具。

athola
athola
热度 63.59
最近更新 2026-08-26 21:06:51
分类:开发依赖:纯提示词应用场景:概念解释

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nm-archetypes-architecture-paradigm-service-based
Metadata
name
architecture-paradigm-service-based
description
Applies coarse-grained service architecture for deployment independence
version
1.9.8
triggers
["architecture","service-based","soa","modular","shared-database","independent deployment is needed but shared databases rule out microservices"]
metadata
{"openclaw":{"homepage":"https://github.com/athola/claude-night-market/tree/master/plugins/archetypes","emoji":"🏗️"}}
source
claude-night-market
source_plugin
archetypes

Night Market Skill — ported from claude-night-market/archetypes. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

The Service-Based Architecture Paradigm

When To Use

  • Multi-team organizations with domain-aligned services
  • Systems requiring independent deployment of components

When NOT To Use

  • Single-team projects small enough for a monolith
  • Latency-sensitive systems where inter-service calls are prohibitive

When to Employ This Paradigm

  • When teams require a degree of deployment independence but are not yet prepared for the complexity of managing numerous microservices.
  • When shared databases or large-scale systems (like ERPs) make full service autonomy unrealistic.
  • When establishing clear service contracts for partner teams or external consumers.

Adoption Steps

  1. Group Capabilities: Bundle related business functions into a small set of well-defined services, each with a designated owner.
  2. Define Service Contracts: Publish formal specifications using standards like OpenAPI or AsyncAPI, including Service Level Agreements (SLAs) and a clear versioning strategy.
  3. Control Database Schemas: Even when services share a database, assign explicit ownership for each schema or table. Gate all breaking changes through a formal review process.
  4. Establish Service Mediation: Use a service registry or an API gateway to handle routing, authentication, and observability.
  5. Plan for Evolution: Identify architectural "hotspots" that are likely candidates for being split into more granular services in the future.

Key Deliverables

  • An Architecture Decision Record (ADR) that outlines service boundaries, data ownership rules, and coordination mechanisms.
  • A suite of contract tests and consumer-driven contract tests for each service to validate stability.
  • Runbooks that describe deployment procedures, rollback plans, and service dependencies.

Risks & Mitigations

  • Coupling Through a Shared Database:
    • Mitigation: Changes to a shared database can have cascading effects across services. Mitigate this by using database views, replication, or a formal schema deprecation schedule to manage change.
  • Architectural Degradation:
    • Mitigation: Without strong governance, this architecture can degrade into a "distributed monolith"—a monolith with the added complexity of network hops. Track coupling metrics closely and enforce strict ownership of services and data to prevent this.

Concrete Components

These vocabulary items name the concrete tools and abstractions that show up when the paradigm is implemented. They are not required dependencies and they are not part of the skill's tools: frontmatter (which is reserved for Claude Code tool restrictions). Use this list to disambiguate during architecture discussions.

  • api-gateway -- single ingress that routes to coarse-grained services and centralizes cross-cutting concerns
  • service-registry -- directory of available services with health status and contracts
  • schema-management -- shared schema repo for types crossing service boundaries