Understanding Events: Inside vs Outside

TLDREvents can be classified as inside or outside events based on their utility. Inside events are internal to a logical boundary, while outside events are used for communication with other service boundaries. They have different characteristics and should be designed accordingly.

Key insights

📌Events can be classified as domain events or integration events, but a further distinction should be made between inside and outside events.

🔍Inside events are events that occur within a logical boundary, while outside events are events that communicate with other service boundaries.

💡Inside events are internal to the system and are often more granular, capturing specific business concepts and behaviors.

🌐Outside events are external events that the system interacts with, often for data propagation or communication purposes.

📊When designing an API, the distinction between private (inside) and public (outside) events becomes important, as they have different contract requirements.

Q&A

What is the difference between domain events and integration events?

Domain events refer to business concepts that occur within a logical boundary, while integration events are used to communicate with other service boundaries.

How should inside events be designed?

Inside events should capture specific business concepts and behaviors within a logical boundary, and they may be more granular in nature.

What are outside events used for?

Outside events are used for data propagation and communication with other service boundaries, providing a way to interact with the external environment.

How should public events be treated in an API?

Public events in an API are part of a contract and should be versioned and designed to meet the needs of external consumers.

What are the characteristics of inside events?

Inside events are internal to the system, capturing the exact intent of what has happened within a logical boundary.

Timestamped Summary

00:00Events can be categorized as inside or outside events based on their utility and purpose.

01:12Domain events occur within a logical boundary, representing specific business concepts and behaviors.

01:56Integration events are used for communication with other service boundaries, often for data propagation or interaction purposes.

04:06Inside events are more granular and capture the exact intent of what has happened within a logical boundary.

05:53Outside events provide a way to interact with the external environment and are often summarized for communication purposes.