Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a domain event in microservices?
A domain event represents something important that happened inside a service's business logic. It reflects a state change or action relevant to the service's core domain, like 'OrderPlaced' or 'PaymentProcessed'.
Click to reveal answer
beginner
Define an integration event and its purpose.
An integration event is used to communicate between different microservices. It shares information about changes so other services can react or update themselves, ensuring loose coupling and eventual consistency.
Click to reveal answer
beginner
What is a notification event and when is it used?
A notification event informs users or external systems about something that happened, like sending an email or SMS. It is often used for alerts, confirmations, or updates outside the core business logic.
Click to reveal answer
intermediate
How do domain events differ from integration events?
Domain events focus on internal business changes within a service, while integration events are designed to share those changes with other services to coordinate actions across the system.
Click to reveal answer
intermediate
Why is it important to separate notification events from domain and integration events?
Separating notification events keeps user communication or external alerts independent from core business logic and service coordination, making the system easier to maintain and scale.
Click to reveal answer
Which event type represents a change inside a single microservice's business logic?
ASystem event
BIntegration event
CNotification event
DDomain event
✗ Incorrect
Domain events capture important changes within a service's own domain.
What is the main purpose of an integration event?
ATo communicate changes between microservices
BTo log internal errors
CTo notify users about system status
DTo trigger UI updates
✗ Incorrect
Integration events share information between services to keep them in sync.
Which event type would you use to send an email confirmation after an order is placed?
ADomain event
BIntegration event
CNotification event
DAudit event
✗ Incorrect
Notification events handle user or external system alerts like emails.
Which statement is true about domain and integration events?
What type of event is this most likely representing?
medium
A. Notification event
B. System event
C. Integration event
D. Domain event
Solution
Step 1: Analyze the event name and context
The event 'UserRegistered' indicates a business action inside the service, such as a user signing up.
Step 2: Match event type to definition
Since it captures a business action inside the service, it is a domain event, not a notification or integration event.
Final Answer:
Domain event -> Option D
Quick Check:
Business action event = Domain event [OK]
Hint: Event names with business actions are domain events [OK]
Common Mistakes:
Assuming all events are integration events
Confusing notification events with domain events
Ignoring event naming conventions
4. A microservice is sending an event to notify users about a password change. The event is mistakenly labeled as an integration event. What is the main issue here?
medium
A. Notification events should not be sent to users
B. Password change is a domain event, not a notification
C. Notification events should not be labeled as integration events
D. Integration events cannot carry user-related data
Solution
Step 1: Identify the event purpose
The event is meant to notify users, which fits the notification event type.
Step 2: Understand event labeling importance
Labeling a notification event as an integration event causes confusion and wrong handling in the system.
Final Answer:
Notification events should not be labeled as integration events -> Option C
Quick Check:
Correct event labeling avoids confusion [OK]
Hint: Match event label to its purpose carefully [OK]
Common Mistakes:
Mixing notification and integration event roles
Assuming integration events can't have user data
Thinking notification events are internal only
5. You are designing a microservices system where a user registration triggers multiple actions: updating internal user stats, notifying other services, and sending a welcome email. Which event types should you use for these actions respectively?
hard
A. Domain event, integration event, notification event
B. Integration event, domain event, notification event
C. Notification event, domain event, integration event
D. Domain event, notification event, integration event
Solution
Step 1: Map actions to event types
Updating internal user stats is a business action inside the service, so it is a domain event.
Step 2: Identify cross-service communication
Notifying other services requires sharing information between services, so it is an integration event.
Step 3: Recognize user alerts
Sending a welcome email is a message to the user, which fits notification events.
Final Answer:
Domain event, integration event, notification event -> Option A
Quick Check:
Internal action, cross-service, user alert = Domain, Integration, Notification [OK]
Hint: Match event type to action scope: internal, cross-service, user [OK]
Common Mistakes:
Swapping integration and notification events
Using domain events for cross-service communication