Chapter 7. Designing Events
There are many ways to design events for event-driven architectures. However, some are more suitable than others for use in an event-driven data mesh. This chapter covers the best strategies for designing events for your event-driven data products, including how to avoid the numerous pitfalls that you will encounter along the way.
Introduction to Event Types
There are two main types of events that underpin all of event design: the state event, as we first introduced in “State Events and Event-Carried State Transfer”, and the delta event, which we’ll cover in more detail in this chapter.
Figure 7-1 shows a simple square wave in steady state, periodically altering from one state to another based on a delta. Similar to this square wave, we model our events to either capture the state itself or the edge that transitions from one state to another.
There are three stages to any occurrence in a system:
-
The initial state
-
The delta that alters the initial state to produce the final state
-
The final state (which is also the initial state for the next change cycle)
The majority of events we encounter can be fully categorized as either state or delta. Looking at events in this way helps separate concerns and focus design efforts:
- State events
-
State events fully describe the state of an entity at a given point ...
Get Building an Event-Driven Data Mesh now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.