Table of contents
No headings in the article.
- Step1: Understand the problem and establish design scope.
- Ask questions, figure out the system's notification type, for SMS/PUSH/EMAIL...
- The platform contains, iOS/Android/laptop.
- The customer's setting, you can turn off.
- The throughput of the system, 10 million/day.
- Step2: Propose high-level design.
- In this phase you should consider following points:
- How User info comes from. (devices/phone num/.etc)
- Core components.And how they integrate.
- Core API and core data struct. user info table?
The service calls
POST https://api.example.com/v/sms/send
to push a notification event into the notification server. One user may have not only one device, so the table looks like: - Sending/receiving flow.
- In this phase you should consider following points:
Step3: Design a deep dive.
- In this phase, we can focus on the non-function requirements.
Reliability. How to prevent data loss? We can persist notification data in a database and implements a retry mechanism.
How to prevent duplicate notifications? We can use a unique id to filter the duplicate notifications.
Rating limiting design To Avoid overwhelming users with too many notifications.
Security in push notifications Only authenticated or verified clients are allowed to send push notifications.
Event tracing Tracing client's action when receiving the event.