title: How would I use Reddis + Azure Event Hubs to handle mobile push notifications archiving for billions of topics?
body: <p>I need to design a system that allows</p>
  
  <ul>
  <li>Users to subscribe to any topic</li>
  <li>No defined topic limit </li>
  <li>Control over sending to one device, or all</li>
  <li>Recovery when offline clients, (or APNS) that drops a notification. Provide a way to catch up via REST</li>
  <li>Discard all updates older than age T.</li>
  </ul>
  
  <p>I studied many different solutions, such as Notification Hubs, Service Bus, Event Hub... and now discovered Kafka and not sure if that's a good fit.</p>
  
  <p><strong>Draft architecture</strong></p>
  
  <ol>
  <li><p>Use an <a href="https://azure.microsoft.com/en-us/pricing/details/event-hubs/" rel="nofollow noreferrer">Event Hub</a> to listen for mobile deviceID registrations, and userIDs that requests for topic subscriptions .. Pass that to Reddis, below </p></li>
  <li><ul>
  <li>If registering a phone/subscribing to a topic, save the deviceID userID to the topic key.  </li>
  <li>If sending a message to a topic, query Reddis for the topic key, and send that result to a FIFO queue for processing.<br>
  Pipe the output of the previous query into the built in Reddis Pub/Sub features to alert worker roles that there is work pending.</li>
  </ul></li>
  <li><p>While the workers send notices to Apple and Firebase, archive out the sent notices to some in-memory store below.</p></li>
  <li><p>Archive server maintains a history of sent events, so that out-of-sync devices can get the most up to date information LIFO-queue style.  </p></li>
  </ol>
  
  <p><strong>Question</strong></p>
  
  <p>What are your thoughts on using this approach to solve the above needs? </p>
  
  <p>What other things should I learn, research, or experiment (measure)?</p>