Event-Driven Microservices Architecture
Loosely-coupled microservices communicating through Kafka with dead letter queue handling and idempotent consumers.
Services
- API Gateway (api_gateway) — Accepts and validates incoming API requests — Kong, NGINX
- Order Service (service) — Manages order creation and state transitions — Java, Spring Boot
- Inventory Service (service) — Manages stock levels and reservations — Go
- Notification Service (service) — Sends notifications on order events — Python
- Kafka (queue) — Central event bus for inter-service communication — Apache Kafka
- Dead Letter Queue (queue) — Stores failed messages for retry and inspection — Apache Kafka
- PostgreSQL (database) — Stores order and inventory data — PostgreSQL
- Redis (database) — Caches inventory counts for fast lookups — Redis
Connections
- API Gateway → Order Service (sync_http)
- Order Service → Kafka (async_event)
- Kafka → Inventory Service (async_event)
- Kafka → Notification Service (async_event)
- Kafka → Dead Letter Queue (async_event)
- Order Service → PostgreSQL (db_access)
- Inventory Service → PostgreSQL (db_access)
- Inventory Service → Redis (db_access)