Wrap Up
Notifications are indispensable because they keep us posted with important information. It could be a push notification about your favorite movie on Netflix, an email about discounts on new products, or a message about your online shopping payment confirmation.
In this chapter, we described the design of a scalable notification system that supports multiple notification formats: push notification, SMS message, and email. We adopted message queues to decouple system components.
Besides the high-level design, we dug deep into more components and optimizations.
-
Reliability: We proposed a robust retry mechanism to minimize the failure rate.
-
Security: AppKey/appSecret pair is used to ensure only verified clients can send notifications.
-
Tracking and monitoring: These are implemented in any stage of a notification flow to capture important stats.
-
Respect user settings: Users may opt-out of receiving notifications. Our system checks user settings first before sending notifications.
-
Rate limiting: Users will appreciate a frequency capping on the number of notifications they receive.
Congratulations on getting this far! Now give yourself a pat on the back. Good job!
Reference materials
- Twilio SMS: https://www.twilio.com/sms
- Nexmo SMS: https://www.nexmo.com/products/sms
- Sendgrid: https://sendgrid.com/
- Mailchimp: https://mailchimp.com/
- You Cannot Have Exactly-Once Delivery: https://bravenewgeek.com/you-cannot-have-exactly-once-delivery/
- Security in Push Notifications: https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-apns
- Key metrics for RabbitMQ monitoring: https://www.datadoghq.com/blog/rabbitmq-monitoring/
Finished reading?
Mark it complete to track your progress.