Communication
Synchronous (REST)
Used for:
- Client-facing API calls via Gateway
- Service-to-service queries (account lookup, customer validation)
- Fraud check synchronous path (with timeout)
Asynchronous (Kafka)
Used for:
- Payment state propagation
- Ledger posting
- Fraud screening (async path)
- Notifications
- Analytics ingestion
When to Use Which
| Criteria | REST | Kafka |
|---|---|---|
| Immediate response needed | ✓ | |
| Fire-and-forget | ✓ | |
| Multiple consumers | ✓ | |
| Strong ordering per entity | ✓ | |
| Simple request/response | ✓ |