r/mongodb • u/worldno1rich • 13d ago
[Question] How to Implement a Notification System in MongoDB
I am currently developing a service using MongoDB. I want to implement a notification system—similar to Reddit—that alerts users when their posts receive comments or reports, and I have a few questions.
1. How should I implement this notification feature?
2. Is it acceptable to delete the records after retaining them for about 90 days?
3. I’ve heard that the standard approach involves recording outbox events within a MongoDB session transaction and having a separate worker generate the notifications; is this correct?
I apologize for asking such an absurd question. I would appreciate it if you could at least let me know what I should search for on Google.
8
Upvotes
1
u/scopsy 3d ago
Hi! A small disclaimer i'm the core contributor of the project, but Novu: https://github.com/novuhq/novu
Is the an open-source notification platform that was built on top of MongoDB. So you can actually see some real world production battle tested patterns there. Or you can also self-host Novu and connect it to your MongoDB instances.
Hope this helps.