Przejdź do treści
Biblioteka skilli
Programowanie · Planowanie

microservices

/microservices

Wspiera architekturę mikroserwisów: dekompozycję usług, wykrywanie usług, rozproszone śledzenie, wyłączniki awaryjne i osobną bazę dla każdej usługi.

Repozytorium
Agent-Skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
01.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
3
Przestarzałość

Brak sygnałów. Repozytorium zmienione 01.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wspiera architekturę mikroserwisów: dekompozycję usług, wykrywanie usług, rozproszone śledzenie, wyłączniki awaryjne i osobną bazę dla każdej usługi.

Oryginalny opis (EN)

Expert Microservices architecture assistance covering service decomposition, service discovery, distributed tracing, circuit breakers, and database-per-service isolation. Use when refactoring monoliths, designing distributed microservice systems, or orchestrating service communications.

Jak działa

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Sekcje z nagłówków SKILL.md, w oryginale · 128 linii, 557 słów
Podgląd SKILL.md
---
name: microservices
description: Expert Microservices architecture assistance covering service decomposition, service discovery, distributed tracing, circuit breakers, and database-per-service isolation. Use when refactoring monoliths, designing distributed microservice systems, or orchestrating service communications.
---

# Microservices

Microservices architecture structures an application as a collection of loosely coupled, independently deployable services. Ideally, each service corresponds to a **Bounded Context** (DDD).

## When to Use

- **Independent Scaling & Deployment**: Different business capabilities (e.g. video processing vs user authentication) require independent scaling.
- **Autonomous Multi-Team Velocity**: Large engineering organizations where decoupled cross-functional teams need to deploy without stepping on each other.
- **Polyglot Technology Requirements**: Leveraging specific runtimes for specific workloads (Python for ML, Go/Rust for networking, Node for APIs).
- **Fault Domain Isolation**: Preventing an out-of-memory crash in a non-critical feature from bringing down the core payment pipeline.

## Quick Start

```yaml
# docker-compose.yml (Simulated Microservices)
services:
  order-service:
    build: ./services/order
    ports: ["3001:3000"]
    environment:
      - DB_HOST=order-db

  inventory-service:
    build: ./services/inventory
    ports: ["3002:3000"]

  api-gateway:
    image: nginx
    ports: ["80:80"]
    depends_on:
      - order-service
      - inventory-service
```

## Core Concepts

### Database-Per-Service Isolation

Each microservice owns its private database. No service can directly query another service's database tables:

```text
[ Orders Service ] ──→ ( Orders DB )
        │ (Async Events / gRPC)
        ▼
[ Customers Service ] ──→ ( Customers DB )
```

### Distributed Tracing (W3C Trace Context)

Correlates requests across multiple network hops using standardized trace IDs:

```typescript
// Injected into outgoing HTTP/gRPC calls
headers: {
  "traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}
```

### Circuit Breakers & Graceful Degradation

Fails fast when downstream services become unresponsive, preventing cascading thread exhaustion:

```typescript
import CircuitBreaker from "opossum";

const breaker = new CircuitBreaker(callRecommendationService, {
  timeout: 1000,
  errorThresholdPercentage: 50,
  resetTimeout: 10000,
});

breaker.fallback(() => [/* Fallback cached generic recommendations */]);
const recommendations = await breaker.fire(userId);
```

## Common Patterns

### Circuit Breaker Pattern

**Problem**: Cascading failures when a downstream dependency experiences degraded response times.  
**Solution**: Wrap external calls in a circuit breaker to fail fast and shed load.

```typescript
import CircuitBreaker from "opossum";

async function fetchPaymentGateway(payload: PaymentPayload) {
  return await http.post("https://payment.example.com/charge", payload);
}

const breaker = new CircuitBreaker(fetchPaymentGateway, {
  timeout: 3000, // 3s timeout
  errorThresholdPercentage: 50, // Open breaker if 50% calls fail
  resetTimeout: 10000, // Wait 10s before attempting half-open state
});

breaker.fallback(() => ({ status: "QUEUED_FOR_RETRY", cached: true }));
const result = await breaker.fire(paymentData);
```

## Best Practices

**Do**:

- Enforce Database-per-Service: Never share a database instance between microservices; communicate via APIs or events.
- Implement Comprehensive Observability: Instrument all services with OpenTelemetry traces, Prometheus metrics, and structured JSON logs.
- Use Contract Testing (Pact): Validate API compatibility between consumer and provider services in CI/CD without running end-to-end clusters.
- Adopt Service Meshes for Mesh Security: Leverage Envoy / Istio for automated mTLS encryption and traffic steering.

**Don't**:

- Start with microservices on day one: Start with a well-structured Modular Monolith until organizational scale warrants extraction.
- Build distributed monoliths: Avoid deep synchronous HTTP chains (Service A calls B, which calls C, which calls D).
- Ignore distributed transactions: Use Saga patterns or eventual consistency rather than two-phase commits.

## Troubleshooting

| Error                | Cause                                          | Solution                                                               |
| :------------------- | :--------------------------------------------- | :--------------------------------------------------------------------- |
| `Cascading Failure`  | One service down takes down others.            | Use Circuit Breakers and Timeouts.                                     |
| `Data inconsistency` | Async updates failed.                          | Implement Sagas and Idempotent consumers.                              |
| `Latency`            | Too many hops (service -> service -> service). | Use Caching, Aggregation at Gateway, or Event-Driven data replication. |

## References

- [Building Microservices (Sam Newman)](https://samnewman.io/books/building_microservices/)
- [Microservices Patterns (Chris Richardson)](https://microservices.io/)

Wersje

RepozytoriumWynikLicencja
Ta strona · G1Joshi/Agent-Skills100MIT
krzysztofsurdy/code-virtuoso100MIT
nimadorostkar/Claude-Skills-collection100MIT
SkillMedev/skills100MIT
MARUCIE/openclaw-foundry100MIT
Tyler-R-Kendrick/agent-skills100MIT
kid-sid/codex-spellbook100MIT
j4flmao/agent-skills95MIT
andreibesleaga/gabbe90CC-BY-4.0

Migawka bazy z 13.11.2026 · wersja paczki 40fed6a8bab9 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100microservices-patterns
    Dostarcza wzorce projektowe mikroserwisów: dekompozycję usług, API gateway, wyłączniki awaryjne, orkiestrację saga i komunikację między usługami.
  • 90microservices-patterns
    Opisuje wzorce architektury mikroserwisów: dekompozycję usług, komunikację, zarządzanie danymi i odporność, przy projektowaniu systemów rozproszonych i rozbijaniu monolitów.
  • 100microservices-expert
    Wspiera architekturę mikroserwisów, wzorce, service mesh i systemy rozproszone, w tym komunikację i zarządzanie danymi.
  • 90microservices-architect
    Projektuje systemy rozproszone i mikroserwisy: granice usług, DDD, wzorce sag, event sourcing, service mesh i śledzenie rozproszone.
  • 95microservices-patterns
    Projektuje architekturę mikroserwisów: granice usług, komunikację zdarzeniową i wzorce odporności przy rozbijaniu monolitu.
  • 80role-backend:microservices
    Projektuje mikroserwisy: podział monolitu, komunikację REST i gRPC, sagi, wyłączniki obwodu oraz śledzenie rozproszone.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.