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.
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:
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.
Candidate: What types of notifications should the system support?
Interviewer: Let's support three types for now: EMAIL, SMS, and PUSH.
Candidate: Should we support retry logic in case a notification fails?
Interviewer: Yes, retrying failed deliveries is important. Assume a simple retry mechanism with a maximum number of retries and a delay between attempts.
Candidate: Should sending be synchronous or asynchronous?
Interviewer: Asynchronous. The system should not block while sending notifications.
Candidate: Will the system support bulk notifications or just single notifications per request?
Interviewer: For this version, let’s keep it simple and only support sending one notification at a time.
After gathering the details, we can summarize the key system requirements.