In today’s cloud-native architecture, designing an efficient notification system is crucial for delivering timely updates and ensuring smooth communication across various services. With the evolution of AWS services, there are multiple approaches to implementing such systems. In this article, we will explore three different implementation strategies for a Learning Management System (LMS) notification system:
- Traditional Approach: Notification Service -> SQS -> Lambda
- SNS Topic Filtering Approach: SNS Topic -> Filtering Based on Metadata/Attribute -> SQS -> Lambda
- EventBridge Filtering Approach: EventBridge -> Filtering Based on JSON Object Values -> SQS -> Lambda
We will also discuss the use cases where each approach is most suitable.
1. Traditional Approach: Notification Service -> SQS -> Lambda
Architecture Overview: The traditional approach involves sending notifications to an SQS (Simple Queue Service) queue, which is then processed by a Lambda function. The Lambda function is responsible for filtering the messages and routing them to the appropriate service based on the content.

Process Flow:
- The Notification Service generates messages that are sent to a central SQS queue.
- A Lambda function polls the SQS queue, processes each message, and filters them according to the notification type (e.g., New Courses, Course Updates, Promotional Offers).
- Based on the filtering logic, the Lambda function routes the message to the corresponding destination.
Code Example:
def lambda_handler(event, context):
for record in event['Records']:
message = json.loads(record['body'])
if message['type'] == 'NewCourse':
send_notification("New Course Available", message)
elif message['type'] == 'CourseUpdate':
send_notification("Course Updated", message)
elif message['type'] == 'PromotionalCourse':
send_notification("Promotional Offer", message)
Use Case:
- Best for small-scale systems where the message volume is low and the filtering logic is simple. It is easy to set up but can become a bottleneck as the system scales due to the centralized Lambda function doing all the filtering.
2. SNS Topic Filtering Approach: SNS Topic -> Filtering Based on Metadata/Attribute -> SQS -> Lambda
Architecture Overview: In this approach, messages are sent to an SNS (Simple Notification Service) topic, where they are filtered based on attributes or metadata before being routed to specific SQS queues. Each SQS queue is then connected to a dedicated Lambda function.

Process Flow:
- The Notification Service publishes messages to an SNS topic.
- The SNS topic filters the messages based on metadata or attributes (e.g.,
notificationType: NewCourse
). - Each filtered message is delivered to the corresponding SQS queue (e.g., NewCourses, CourseUpdates, PromotionalOffers).
- Dedicated Lambda functions poll each SQS queue and process the messages.
Code Example:
def publish_notification(message, notification_type):
sns.publish(
TopicArn='arn:aws:sns:region:account-id:CourseNotifications',
Message=message,
MessageAttributes={
'notificationType': {
'DataType': 'String',
'StringValue': notification_type
}
}
)
# Example usage
publish_notification(new_course_message, 'NewCourse')
publish_notification(course_update_message, 'CourseUpdate')
publish_notification(promotional_message, 'PromotionalCourse')
Use Case:
- Ideal for medium to large-scale systems with multiple types of notifications. The filtering is offloaded to SNS, reducing the processing load on Lambda functions. This approach scales better and allows for more granular control over message routing.
3. EventBridge Filtering Approach: EventBridge -> Filtering Based on JSON Object Values -> SQS -> Lambda
Architecture Overview: In this modern approach, Amazon EventBridge is used to filter messages based on the values within the JSON object itself, without relying on additional metadata or attributes. This method provides more flexibility in defining complex filtering rules.

Process Flow:
- The Notification Service sends messages to an EventBridge event bus.
- EventBridge applies filtering rules directly on the JSON object values (e.g., checking if the
Type
field isNewCourse
). - Filtered messages are routed to the appropriate SQS queue (e.g., NewCourses, CourseUpdates, PromotionalOffers).
- Dedicated Lambda functions handle the processing of messages from each SQS queue.
Code Example:
Use Case:
def send_event(event_detail, event_type):
eventbridge.put_events(
Entries=[
{
'Source': 'com.lmsplatform',
'DetailType': 'CourseNotification',
'Detail': json.dumps(event_detail),
'EventBusName': 'default',
'Resources': [event_type]
}
]
)
# Example usage
send_event(new_course_event, 'NewCourse')
send_event(course_update_event, 'CourseUpdate')
send_event(promotional_event, 'PromotionalCourse')
- Best for complex systems where message filtering needs to be based on the actual content of the messages rather than predefined attributes. This approach provides more flexibility and allows for intricate filtering logic that can adapt to various use cases.
Bu it does come with certain limitations. These include higher costs compared to other AWS services like SNS and SQS, as well as default quotas that might need adjustment for very high-throughput or complex systems.
For example :
- EventBridge has a default soft limit of approximately 1,900 events per second per event bus. If your system needs to handle more than this, you’d need to request a limit increase from AWS through their support
- By default, you can have up to 100 event buses per AWS account in each region. If you need more, you would need to request an increase.
Comparative Analysis and Summary

Conclusion: Each approach offers unique advantages depending on the complexity and scale of your notification system. The traditional approach is straightforward but may not scale well. The SNS Topic Filtering method offers a good balance between scalability and complexity, making it suitable for many mid-sized applications. On the other hand, EventBridge Filtering is ideal for scenarios requiring sophisticated filtering directly from message content, providing the most flexibility and scalability.