Skip to content
Back to skills

Microservices Architecture

ASecurity

Microservices architecture patterns and design. Use when user asks to "design microservices", "service decomposition", "API gateway", "distributed transactions", "circuit breaker", "service mesh", "event-driven architecture", "saga pattern", "service discovery", or mentions microservices design patterns and distributed systems.

  • 225 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 4, 2026
devopsjavascriptjavakubernetesawsdebuggingapidatabasesecuritydocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill microservices-architecture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Microservices Architecture?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Microservices Architecture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-microservices-architecture-learn-skills-dev/badge)](https://www.skillsdirectory.com/skills/neversight-microservices-architecture-learn-skills-dev)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: microservices-architecture
description: Microservices architecture patterns and design. Use when user asks to "design microservices", "service decomposition", "API gateway", "distributed transactions", "circuit breaker", "service mesh", "event-driven architecture", "saga pattern", "service discovery", or mentions microservices design patterns and distributed systems.
---

# Microservices Architecture

Patterns and best practices for designing and implementing microservices architectures.

## Core Patterns

### Service Decomposition
- Domain-driven design (bounded contexts)
- Business capability based
- Ownership clarity
- Technology diversity

### API Gateway Pattern
```
Client → API Gateway → Service 1
                    → Service 2
                    → Service 3
```
- Single entry point
- Authentication/authorization
- Request routing
- Rate limiting

### Database per Service
- Each service owns its database
- Data consistency challenges
- Enables technology diversity

### Event-Driven Communication
```
Service A → Event Bus → Service B
           → Service C
```
- Loose coupling
- Eventual consistency
- Event sourcing

## Reliability Patterns

### Circuit Breaker
```javascript
// Fails fast when service is unavailable
const breaker = new CircuitBreaker(async () => {
  return await serviceCall();
}, {
  threshold: 5,        // Fail after 5 errors
  timeout: 60000       // Check after 60s
});
```

### Retry Logic
```javascript
// Exponential backoff
const maxRetries = 3;
const baseDelay = 1000;
for (let i = 0; i < maxRetries; i++) {
  try {
    return await service.call();
  } catch (e) {
    if (i === maxRetries - 1) throw e;
    await sleep(baseDelay * Math.pow(2, i));
  }
}
```

### Timeout Management
- Set reasonable timeouts
- Cascading timeout calculation
- Fail fast strategy

## Consistency Patterns

### Two-Phase Commit (2PC)
- Synchronous, strong consistency
- Blocking, reduced availability
- Use sparingly

### Saga Pattern
```
Transaction 1: Service A
  ↓ success
Transaction 2: Service B
  ↓ success
Transaction 3: Service C
  ↓ failure → Compensating transactions
```
- Long-running transactions
- Eventual consistency
- Compensating actions on failure

### Event Sourcing
- Append-only event log
- Reconstible state
- Audit trail built-in

## Monitoring & Operations

### Distributed Tracing
- Correlate requests across services
- Identify latency bottlenecks
- Tools: Jaeger, Zipkin

### Logging
- Structured logging with correlation IDs
- Centralized log aggregation
- Tools: ELK, Splunk

### Metrics
- Per-service metrics
- Request latency, throughput
- Resource usage

## Service Mesh

### Istio/Linkerd
- Manages service-to-service communication
- Traffic management
- Security policies
- Observability

## Configuration Management

```yaml
# Environment-specific config
app:
  database:
    url: ${DB_URL}
    timeout: ${DB_TIMEOUT:-5000}
  cache:
    ttl: ${CACHE_TTL:-3600}
  security:
    jwtSecret: ${JWT_SECRET}
```

## Deployment Strategies

### Blue-Green Deployment
- Two identical environments
- Switch traffic instantly
- Quick rollback

### Canary Deployment
- Gradual rollout to subset of users
- Monitor metrics
- Expand if successful

### Rolling Deployment
- Gradual replacement of old instances
- No downtime
- Longer deploy time

## API Design for Microservices

- RESTful or gRPC
- Versioning strategy
- Backward compatibility
- Documentation (OpenAPI)

## Challenges & Solutions

| Challenge | Solution |
|-----------|----------|
| Distributed transactions | Saga pattern, event sourcing |
| Data consistency | Eventual consistency acceptance |
| Service discovery | Service registry (Consul, Eureka) |
| Latency | Caching, async communication |
| Debugging | Distributed tracing, correlation IDs |
| Complexity | API gateway, service mesh |

## Team Organization

- Cross-functional teams per service
- Clear API contracts
- Ownership and accountability
- Communication patterns

## References

- Sam Newman - Building Microservices
- Chris Richardson - Microservices Patterns
- Kubernetes in Action
- AWS Microservices Architecture
- Kong API Gateway Guide

Files in this skill

  • SKILL.md4.1 KB
  • description_ar.txt580 B
  • description_cn.txt302 B
  • description_de.txt386 B
  • description_en.txt330 B
  • description_es.txt390 B
  • description_fr.txt423 B
  • description_it.txt401 B
  • description_ja.txt571 B
  • description_ko.txt387 B
  • description_ru.txt707 B
  • description_tw.txt305 B
  • stats.json65 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.