How to Batch Notifications w/o Building an Aggregation Engine? (sample github app given)

Search for a command to run...

No comments yet. Be the first to comment.
Toast messages are a common feature in modern mobile apps, offering users quick feedback or guidance. Crafting an effective toast message involves attention to several elements, including platform-specific styles, usability, typography, color, and lo...

In our previous setup, the initial problem seemed straightforward: implementing a scheduling mechanism for database queries using goroutines. This approach worked well with minimal resources and SQLite in a Go service. However, when integrating this ...

The problem initially appeared straightforward, but it quickly became apparent that we had underestimated its complexity. In our prior setup, we relied on goroutines to schedule database queries, enabling us to operate efficiently with minimal resour...

A good notification service is more than a communication channel; it can bridge the gap between the product and the users, increasing product adoption. Think of it this way: timely and relevant #alerts can nudge users with some actionable intent for ...

I set out to tackle a common issue faced by users of social media and collaborative platforms: notification fatigue. Inspired by the notification strategies employed by major platforms like LinkedIn, MS Teams, and Google Workspace, I aimed to create a tutorial demo application that demonstrated the power of batching notifications. This batching technique consolidates multiple alerts into a concise summary within a single notification, reducing interruptions and creating a clutter-free user experience.
You can explore the hands-on implementation through the following links:
GitHub: SuprSend Social App
Deployed Application: SuprSend Demo
More on Batching: Batch (suprsend.com)
Frequent notifications can overwhelm users, leading to disengagement. Batching notifications helps maintain user attention and promotes sustained interaction. However, developing an efficient batching system involves sophisticated workflows and substantial development effort.

Here’s a breakdown of the key components involved in batching notifications:
Aggregation Engine:
Aggregates related notifications (e.g., likes, shares, comments) based on metadata.
Example: Instagram separates story likes and comments to ensure clarity.
Batching Window:
Can be fixed (e.g., every 30 minutes) or dynamic (e.g., user-specific intervals).
Example: LinkedIn batches email alerts for new messages every 30 minutes, while Google Docs batches comments based on user activity.
Scheduling:
Determines the optimal time for delivering notifications.
Example: SaaS companies often send a daily digest of activities the following morning.
Batched Message Presentation:
Options range from simple counters to detailed summaries, balancing informativeness and engagement.
Example: "Patrick and 3 others liked your photo" versus listing all activities.
Cancelling Aggregation:
Adjusts the aggregation counter for counter-activities within the batching window.
Example: If a user likes and then unlikes a post within the batching window, the counter is adjusted accordingly.
To bring this concept to life, I decided to build a React application using SuprSend's notification infrastructure. Here’s how I did it:
Project Setup:
Created a React application and integrated SuprSend's SDK (React and JS)
Set up a SuprSend account and ensured successful event calls with the necessary details. Here's how the notification workflow for this project looks like:

Identifying Triggers:
Identified recurring events suitable for batching. For this demo, I used the Like_Event whenever someone likes a post. Using SuprSend’s JavaScript SDK, I sent these events to the backend.

Code Snippet used:

Configuring Batch Parameters:
Configured batch parameters using SuprSend’s workflow builder:
Batch Window: Set a fixed batch window of 15 seconds for quick testing.
Batch Key: Defined a custom batch key based on the userName variable to batch likes on different posts separately.
Retain Batch Events: Retained 15 objects in the array for this demo.

Creating Notification Templates:
Created templates in SuprSend’s editor using Handlebar Helpers to format notifications based on the batched event count. The template looked like this:
{{#compare $batched_events_count '>' 1}}
{{ $batched_events.[0].username }} and {{ subtract $batched_events_count 1 }} others liked your post.
{{else}}
{{ $batched_events.[0].username }} liked your post.
{{/compare}}

Final result?

To further enhance the user experience, I introduced throttling to limit the frequency of notifications. By setting an upper limit on daily notifications, users are not overwhelmed even with multiple batches. I will discuss this in the next post.
The final demo application successfully demonstrated the benefits of batching notifications in maintaining user engagement. You can explore the hands-on implementation through the following links:
GitHub: SuprSend Social App
Deployed Application: SuprSend Demo