Architecture: How to build a notification system similar to Facebook?
At our company we're building a platform that will need to send notifications to users.
Example of such notifications are:
- User answered your question.
- User liked your question.
- There are X new question in a group you belong to.
We need to process these notifications and decide if:
- Notification will be stored in DB table to be displayed on our website & mobile apps UI
- Some notifications will also sent by email (depending on user settings)
- Some notifications will be sent via Push Notification to mobile devices (and desktop in future)
Some of the notification should be send in "almost" real-time, but at the same time we like to aggregate them so we will not spam our users.
For example if a single question gets 10 likes at the same time, we don't want to send 10 emails, 10 push, and 10 notification in the Web UI. We would like to somehow aggregate them and at the same time be as "real-time" as possible.
What architecture, tools and strategy will you use to design such system? It should be fast and efficient as possible, support real-time push and aggregation of notifications.
Thanks a lot!