This is somewhat of a complicated subject. Each application has it's own needs but I'm curious to know what best practices and architecture you all recommend when storing a user's notifications in a Node.js + MongoDB application.<p>Essentially, we have a notifications icon in our web application (similar to Facebook etc.) that shows notifications based on certain events triggered by other users in the application. Some notifications can also have actions when clicked on them.<p>The plan I had:<p>1. Store all notifications in a 'notifications' collection<p>2. Each document in the collection has the notification text, unread status and action (if applicable)<p>3. When the user clicks the notification icon in the interface, they see a list of unread notifications and upon closing the drawer, an XHR gets called to mark all notifications as read<p>Is this a good way to do it?
I'm not even sure I understand what design issue you're trying to solve. Users have a list of notifications and they have associated metadata. What else would you do?