Skip to main content

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

MethodEndpointAuthDescription
GET/api/v1/notificationsBearerList notifications
PUT/api/v1/notifications/preferencesBearerUpdate preferences
GET/api/v1/notifications/{id}BearerGet notification

Database

TableKey ColumnsDescription
notificationsid, customer_id, channel, template, statusNotification records
templatesid, name, channel, bodyMessage templates
delivery_lognotification_id, attempt, status, timestampDelivery 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.