Posts

Showing posts from July, 2021

Design a notification system

Image
Design a notification system Functional Requirements Users receive notifications as the events happen within the platform Users can subscribe to a channel to receive all relevant notifications Users can receive notifications in their respective client app (Mobile, web, integrations) Notification can be rate-limited Non-Functional Requirements Always available Easy to add new clients Scalable: Linearly scalable What is the scale of the system? Average of 50k notifications a day  — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —  Could there be Some Questions — Answers? What kind of notifications? Push notification, SMS, EMail What have supported devices? IOS, Android, Laptop / Device Design Constraints Average of 50K notifications a day. Per notification would be 100 chars. Every char 2 Byte. 100 chars X 2 Byte = 200 Byte And we need to store some metadata(Id, user_id, date, device_type etc. ) for notification , and we assume 100 bytes : 200 * 1000 = 20000 bayt 50.000 * 2000