rw-book-cover

Metadata

Highlights

  • Figure 9 (View Highlight)
  • Third party services are responsible for delivering notifications to users. While integrating with third-party services, we need to pay extra attention to extensibility. Good extensibility means a flexible system that can easily plugging or unplugging of a third-party service. Another important consideration is that a third-party service might be unavailable in new markets or in the future. For instance, FCM is unavailable in China. Thus, alternative third-party services such as Jpush, PushY, etc are used there. (View Highlight)
  • Figure 10 shows the improved high-level design. Figure 10 (View Highlight)
  • Cache: User info, device info, notification templates are cached. (View Highlight)
  • Message queues: They remove dependencies between components. Message queues serve as buffers when high volumes of notifications are to be sent out. Each notification type is assigned with a distinct message queue so an outage in one third-party service will not affect other notification types. (View Highlight)
  • how every component works together to send a notification:
    1. A service calls APIs provided by notification servers to send notifications.
    2. Notification servers fetch metadata such as user info, device token, and notification setting from the cache or database.
    3. A notification event is sent to the corresponding queue for processing. For instance, an iOS push notification event is sent to the iOS PN queue.
    4. Workers pull notification events from message queues.
    5. Workers send notifications to third party services.
    6. Third-party services send notifications to user devices. (View Highlight)