DEV Community

Cover image for Building Batching Notifications Using MongoDB, Django, Celery and Sendgrid
Nik L.
Nik L.

Posted on

Building Batching Notifications Using MongoDB, Django, Celery and Sendgrid

What are Batched Notifications?

Batch notifications consolidate multiple individual notifications into a single message, delivered within a designated time frame. This approach differs from traditional systems that send a separate notification for each event, helping to reduce notification noise and enhance user engagement.

For instance, in a document collaboration app, rather than sending an email for every single comment, a batch notification system sends one email containing all comments made within the specified time window.

Designing a Batched Notification System

Aspect Batch on Write Batch on Read Our Approach
Method Accumulate notifications into batches as events occur, optimizing lookups. Periodically batch unsent notifications by querying them. Batch on Write
Performance More efficient with better performance and scalability. Can be less efficient as data volume grows. More initial effort required but offers better scalability.
Scalability Higher scalability due to real-time batching. Lower scalability, can be affected by data volume. Higher scalability

Database Design with MongoDB

Collection Description
notifications Tracks individual notifications.
notification_batches Tracks batched notifications.
notification_batch_notifications Links individual notifications to batches.

You can find the codes and implementation in this:
https://www.suprsend.com/post/building-a-batch-notification-system-with-mongodb-django-celery-and-sendgrid-for-developers


Do consider sharing that article on Hackernews, or giving us a star on the Github application.


Give a Star

Top comments (0)