I would do it the following way :
Define a collection in MongoDB that holds your notifications. The schema would look like following :
{
_id : 'String',
dateAdded : 'Date',
to : ['String'],
metaData : {},
seen : 'Boolean'
..... Other Data .......
}
Whenever you need to add a new notification into the system, you insert a new record into the above collection. The property to is an array which indicates the receivers of the notification. This can be an array an ids.
Now when a user loads your web page, retrieve notifications whose to property contains the id of the corresponding user. Once you display the notifications, you may update the seen property.
Making it Realtime :
If you want to develop an in-house solution, you can use socket.io for this. You can publish the same notification instance that you store in MongoDB to Socket.io. Basically, you need to look at the to property and broadcast an event only to those users from Socket.io.
Take a look at the following links :
getStream : You can build powerful notification feeds and make them realtime using this hosted API. They have a free plan which lets you add 3M activities per month. They also offer a Node.js client which works pretty well.
Push Notifications using Socket.io.
Kentrell Gigi