askill
microservices-knowledge

microservices-knowledgeSafety 95Repository

Microservices Architecture knowledge base. Provides service decomposition, communication patterns, API gateway, service discovery, and data management guidelines for architecture audits and generation.

44 stars
1.2k downloads
Updated 2/22/2026

Package Files

Loading files...
SKILL.md

Microservices Architecture Knowledge Base

Quick reference for microservices architecture patterns and PHP implementation guidelines.

Core Principles

Architecture Overview

┌──────────────────────────────────────────────────────────────────────────┐
│                     MICROSERVICES ARCHITECTURE                           │
├──────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│   ┌──────────┐     ┌──────────────────┐     ┌──────────────────┐        │
│   │  Client   │────▶│   API Gateway    │────▶│   Service A      │        │
│   │          │     │  (Routing/Auth)   │     │  (Own Database)  │        │
│   └──────────┘     └──────────────────┘     └──────────────────┘        │
│                           │                       │                      │
│                           │                       │ async                │
│                    ┌──────▼──────┐          ┌─────▼──────────┐          │
│                    │  Service B  │          │  Message Broker │          │
│                    │ (Own DB)    │◀─────────│  (Events/Cmds)  │          │
│                    └─────────────┘          └────────────────┘          │
│                                                                          │
├──────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│   Decomposition Strategies:                                              │
│   • By Business Capability    - Align with bounded contexts             │
│   • By Subdomain (DDD)        - Core, Supporting, Generic               │
│   • Strangler Fig              - Incremental migration from monolith    │
│                                                                          │
│   Communication:                                                         │
│   • Synchronous  - REST, gRPC, GraphQL (request-response)              │
│   • Asynchronous - Message queues, event streaming                      │
│                                                                          │
└──────────────────────────────────────────────────────────────────────────┘

Service Communication Patterns

PatternTypeUse WhenTrade-off
RESTSyncCRUD, simple queriesEasy but coupling
gRPCSyncInternal service-to-service, performance-criticalFast but schema coupling
GraphQLSyncClient-driven queries, BFFFlexible but complex
Message QueueAsyncReliable delivery, work distributionDecoupled but eventual consistency
Event StreamingAsyncReal-time, event sourcing, audit trailsScalable but complex ordering
Request-ReplyAsyncAsync request needing responseDecoupled but higher latency

API Gateway Patterns

PatternDescriptionWhen to Use
Simple ProxyRoutes requests to servicesSmall number of services
Gateway AggregationCombines multiple service callsReduce client round-trips
BFF (Backend for Frontend)Gateway per client typeMobile vs Web vs API clients
Gateway OffloadingAuth, rate limiting, TLSCross-cutting concerns

Service Discovery

ApproachHow It WorksExample
Client-sideClient queries registry, selects instanceNetflix Eureka
Server-sideLoad balancer queries registryAWS ALB, Kubernetes
DNS-basedDNS SRV records resolve to instancesConsul DNS, CoreDNS
Platform-nativeContainer orchestrator handles routingKubernetes Services

Data Management

PatternDescriptionConsistency
Database per ServiceEach service owns its dataStrong (within service)
Shared DatabaseServices share one databaseStrong (anti-pattern!)
SagaDistributed transaction via eventsEventual
CQRSSeparate read/write modelsEventual
Event SourcingEvents as source of truthEventual
API CompositionQuery multiple services, merge resultsEventual

When to Use Microservices vs Monolith

FactorMonolithMicroservices
Team size< 10 developers> 10, multiple teams
Domain complexitySimple/moderateComplex, many bounded contexts
Scalability needsUniform scalingIndependent scaling per component
Deployment frequencyInfrequent, coordinatedFrequent, independent
Technology diversitySingle stackPolyglot needed
Organizational maturityStarting outDevOps culture, CI/CD mature

Detection Patterns

# Service boundary indicators
Grep: "HttpClient|GuzzleHttp|curl_init" --glob "**/Infrastructure/**/*.php"
Grep: "grpc|protobuf" --glob "**/*.php"

# API Gateway patterns
Grep: "X-Forwarded|X-Request-ID|X-Correlation" --glob "**/*.php"
Glob: **/Gateway/**/*.php

# Service discovery
Grep: "ServiceDiscovery|ServiceRegistry|consul|etcd" --glob "**/*.php"
Grep: "KUBERNETES_SERVICE|SERVICE_HOST" --glob "**/*.env*"

# Database per service
Grep: "DATABASE_URL|DB_CONNECTION" --glob "**/*.env*"
Grep: "DATABASE_HOST|DB_HOST" --glob "**/docker-compose*.yml"

# Inter-service communication
Grep: "AMQPChannel|RabbitMQ|Kafka|SQS" --glob "**/Infrastructure/**/*.php"
Grep: "EventPublisher|MessageBus" --glob "**/*.php"

References

For detailed information, load these reference files:

  • references/patterns.md — Service mesh, API gateway implementations, service discovery details, data consistency
  • references/antipatterns.md — Distributed monolith, shared database, missing boundaries, chatty communication

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

74/100Analyzed 2/24/2026

Solid microservices knowledge base with good visual diagrams, comprehensive pattern tables, and useful detection patterns. Scores well on clarity, safety, and reusability. Main weaknesses are moderate actionability (lacks clear usage triggers/steps) and moderate completeness (missing implementation guidance). The content serves well as a reference but could benefit from a 'when to use' section and more practical step-by-step guidance for architecture audits.

95
88
78
72
55

Metadata

Licenseunknown
Version-
Updated2/22/2026
Publisherdykyi-roman

Tags

apici-cddatabasegraphqlsecurity