AlgoMaster Logo

Design a Notification System

Ashish

Ashish Pratap Singh

easy

A Notification System is a critical component in modern applications used to inform users about events such as new messages, payment updates, reminders, and alerts.

Notification System

For example, when a user receives a friend request or their order is shipped, the system should notify them via their preferred channels (like email or push notification) based on their settings.

In this chapter, we will explore the low-level design of a Notification System in detail.

Let’s start by clarifying the requirements:

1. Clarifying Requirements

Before diving into the design, it’s essential to clarify how the notification system is expected to behave. Asking the right questions helps uncover assumptions, define boundaries, and shape the system with confidence and clarity.

After gathering the details, we can summarize the key system requirements.

1.1 Functional Requirements

  • The system should support sending notifications via EMAIL, SMS, and PUSH.
  • Each notification targets a single recipient and a specific channel.
  • The system should send notifications asynchronously.
  • If sending fails, the system should retry the operation a few times before giving up.
  • Notifications may contain a subject (optional) and a message body (mandatory).

1.2 Non-Functional Requirements

  • The system should follow object-oriented design with clear separation of concerns.
  • It should be extensible, allowing future support for new notification types (e.g., WhatsApp, Slack).
  • Delivery should be non-blocking, using a thread pool to manage parallel sending.

2. Identifying Core Entities

Premium Content

This content is for premium members only.