JTech
JTech

JTech

The notification system

Photo by Alexander Shatov on Unsplash

The notification system

system design

JTech's photo
JTech
·Jun 5, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

  • 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: image_1654417784974_0.png
      • Sending/receiving flow. image_1654417369323_0.png
  • 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. image_1654418572947_0.png

 
Share this