Programování
Expert
Claude
Microservices communication pattern
Implementace komunikace mezi microservices (REST/gRPC/message queue).
Prompt text
Délka: Střední
Navrhni communication pattern pro microservices:
**Services:**
1. [SERVICE 1] - responsibilities
2. [SERVICE 2] - responsibilities
3. [SERVICE 3] - responsibilities
**Communication Needs:**
[SCENARIOS - např. Service A needs data from Service B, async notifications]
**Pattern Type:**
[SYNCHRONOUS/ASYNCHRONOUS/HYBRID]
**Options:**
1. **Sync:** REST, gRPC
2. **Async:** Message queue (RabbitMQ, Kafka), Event bus
**Design:**
- API contracts (proto/OpenAPI)
- Error handling & retries
- Circuit breaker
- Service discovery
- Authentication (service-to-service)
- Monitoring & tracing
**Provide:**
- Architecture diagram (text description)
- Implementation examples
- Pros/cons of chosen pattern
- Failure scenarios
Stack: [STACK].
**Services:**
1. [SERVICE 1] - responsibilities
2. [SERVICE 2] - responsibilities
3. [SERVICE 3] - responsibilities
**Communication Needs:**
[SCENARIOS - např. Service A needs data from Service B, async notifications]
**Pattern Type:**
[SYNCHRONOUS/ASYNCHRONOUS/HYBRID]
**Options:**
1. **Sync:** REST, gRPC
2. **Async:** Message queue (RabbitMQ, Kafka), Event bus
**Design:**
- API contracts (proto/OpenAPI)
- Error handling & retries
- Circuit breaker
- Service discovery
- Authentication (service-to-service)
- Monitoring & tracing
**Provide:**
- Architecture diagram (text description)
- Implementation examples
- Pros/cons of chosen pattern
- Failure scenarios
Stack: [STACK].
Příklad použití
Vstup:
Navrhni communication pro: Order Service, Payment Service, Notification Service. Scenarios: Order → Payment (sync verification), Payment success → Notification (async). Pattern: hybrid. Stack: Node.js, RabbitMQ.
Výstup:
Hybrid architecture: Order→Payment sync gRPC (immediate response needed, retry with exponential backoff, circuit breaker after 3 failures, 2s timeout), Payment→Notification async via RabbitMQ (event "payment.completed", durable queues, dead letter queue for failures, idempotent consumers). Service discovery: Consul. Auth: JWT for service-to-service. Monitoring: distributed tracing (OpenTelemetry). Proto contracts for gRPC, event schemas for RabbitMQ. Failure scenarios: Payment down (circuit breaker opens, fallback response), RabbitMQ down (retry publish, fallback to polling). Pros: sync where needed, async for flexibility. Cons: complexity, eventual consistency.
Kde použít tento prompt?
Najděte vhodné AI nástroje pro použití tohoto promptu a maximalizujte jeho efektivitu.
Podobné prompty
Advanced AI Features - Deep Dive do Pokročilých Funkcí
Komplexní průvodce pokročilými funkcemi AI nástrojů - od extended context a multimodality po tool use, streaming, a fine-tuning. Naučte se využívat plný potenciál moderních AI systémů.
Programování
Zobrazit
Algoritmus optimalizace
Optimalizace algoritmu z O(n²) na O(n log n) nebo lepší.
Programování
Zobrazit
API design s REST best practices
Návrh RESTful API s dokumentací a error handling.
Programování
Zobrazit
CI/CD pipeline setup
Konfigurace GitHub Actions / GitLab CI pipeline s testing a deployment.
Programování
Zobrazit
Objevte další AI prompty
Prozkoumejte naši sbírku Programování promptů a najděte ty, které vám pomohou dosáhnout lepších výsledků.