Notification Service
Purpose
Multi-channel customer notifications — email, SMS, push, and in-app.
Responsibilities
- Notification dispatch
- Template management
- Delivery tracking
- Channel preference management
- Retry on delivery failure
Non-Responsibilities
- Business event interpretation (source services)
- Customer data (reads from events)
APIs
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/notifications | Bearer | List notifications |
| PUT | /api/v1/notifications/preferences | Bearer | Update preferences |
| GET | /api/v1/notifications/{id} | Bearer | Get notification |
Database
| Table | Key Columns | Description |
|---|---|---|
| notifications | id, customer_id, channel, template, status | Notification records |
| templates | id, name, channel, body | Message templates |
| delivery_log | notification_id, attempt, status, timestamp | Delivery attempts |
Kafka
Produces: None
Consumes: NotificationRequested
Consumer group: notification-service-group
Dependencies
Sync: External providers (SES, SNS, Twilio) Async: Kafka consumer
Failure Handling
- Provider down → retry with exponential backoff → DLQ
- Invalid address → mark failed, no retry
Scaling
Event-driven, scales with consumer group members.
Security
Customers see own notifications only.
Observability
Metrics: notification_sent_total, notification_delivery_latency.