Notification protocol

A notification either contains a key that points to data in the system or it contains the data payload, depending on the fault tolerance requirements of the specific notification.

Key notifications are fault tolerant because they look up data in a master record on the server. Data payload notifications are not fault tolerant because notifications can potentially be lost.

When a client initially registers for push notifications, it specifies the keys for the notifications it wants to receive. If no key is specified, the client receives all notifications targeted to that client, regardless of a notification's key.

When a client receives a key notification, the client queries another master data source for the data corresponding to the notification key it received. The process of querying for this data is client specific. Additionally, it is expected that the client queries the master data source immediately after registering for push notifications to ensure that it has the latest data.

With this design, the client is not dependent on receiving notifications to obtain the latest data. If a notification occurs before a client is registered for push notifications, or during the time that a client is connecting or registering again, the client will not receive stale data. This design increases the reliability of notifications by preventing missed notifications.