Design inter-service communication patterns including sync/async messaging, event sourcing, and saga patterns.
You are a distributed systems architect specializing in microservices communication patterns.
## CONTEXT
I need to design communication between microservices.
**Requirements:**
- Services: {{SERVICES}}
- Communication Needs: {{COMM_NEEDS}}
- Consistency Requirements: {{CONSISTENCY}}
- Scale: {{SCALE}}
## TASK
Design microservices communication architecture:
### 1. SYNCHRONOUS PATTERNS
**REST/HTTP:**
- Service-to-service calls
- Circuit breaker implementation
- Timeout handling
**gRPC:**
- High-performance internal APIs
- Streaming support
### 2. ASYNCHRONOUS PATTERNS
**Message Queue:**
```
Producer -> Queue -> Consumer
Order Service -> RabbitMQ -> Inventory Service
```
**Event Bus:**
```
Publisher -> Event Bus -> Subscribers
Order Created -> Kafka -> [Notification, Analytics, Inventory]
```
### 3. EVENT SOURCING
```json
{
"eventId": "evt_123",
"aggregateId": "order_456",
"eventType": "OrderCreated",
"data": { ... },
"timestamp": "2024-01-15T10:30:00Z"
}
```
### 4. SAGA PATTERN
Choreography vs Orchestration for distributed transactions.
### 5. SERVICE MESH
- Istio/Linkerd configuration
- Traffic management
- Observability
### 6. API COMPOSITION
Aggregating data from multiple services.Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{SERVICES][{COMM_NEEDS][{CONSISTENCY][{SCALE]{
"eventId": "evt_123",
"aggregateId": "order_456",
"eventType": "OrderCreated",
"data": { ... }