lastuser icon indicating copy to clipboard operation
lastuser copied to clipboard

Use a reliable queue for push notifications

Open jace opened this issue 9 years ago • 0 comments
trafficstars

Rather than the current webhook model for push notifications to client apps, Lastuser should provide a reliable queue mechanism that works across the web, perhaps using MQTT. This will help client apps be assured that they've never missed an update, including delete notifications.

There are two ways this could work:

  1. An MQTT topic for every user or other principal, and all clients subscribe to all topics they are interested in, at risk of this running into hundreds of thousands of topics.
  2. An MQTT topic for every client, with Lastuser repeating the message to each client via its topic. This makes sending from within Lastuser slightly inefficient, necessitating a background job (as currently exists), but it makes the receiving side vastly more efficient.

The second option seems more efficient, but it still leaves open questions:

  1. How is authentication done? For clients? For Lastuser itself?
  2. Will we continue to have webhook notifications?
  3. What happens if a client stops receiving for a long time? How long do we pile up notifications? Does MQTT support timeouts after which messages are dropped?

jace avatar Mar 01 '16 07:03 jace