DEV Community

Ewerson Vieira Nascimento
Ewerson Vieira Nascimento

Posted on

A Quick Introduction to Event Storming

Photo by [Jason Goodman](https://unsplash.com/@jasongoodman_youxventures?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)

When talking about system design, there’s a powerful tool used to obtain a better understanding of what should be built: Event Storming, a teamwork technique that acts as your compass to solve the complexities of business processes and system structures. In this guide, we’ll explore the basics of Event Storming through some small real-life examples.

1. Getting Ready: Set the Stage

Before diving in, gather a team with different skills — experts, developers, and stakeholders. Grab your team, sticky notes, and markers (or use a tool like Miro). Clearly define what you want to achieve in your modeling session — maybe defining how the refund feature should work in your system.

2. Actors: Who’s in the Mix

Actors are the individuals or external systems interacting with your system. In a cinema booking system, the actors could be customers (users) initiating actions like BookTicket or CancelReservation.

Defining Actors: Ask, “Who interacts with our system? What roles do users or external systems play in our scenario?”

3. Commands: Actions That Matter

Commands are the actions triggering changes in your system — user or system-initiated moves. In the cinema system, a command might be PlaceOrder when a customer decides to book tickets.

Defining Commands: Explore actions users can make: “What actions can users take, and when do these actions occur in the system?”

4. Events: The Big Moments

Events are significant occurrences affecting your system. In the cinema system, TicketBooked or ReservationCancelled are events marking key moments.

Defining Events: Identify moments of change: “What significant occurrences or state changes happen in response to user actions or external factors?”

5. Time-Triggered Events: Scheduled Surprises

Time-triggered events occur at predefined intervals, independent of external stimuli. In our cinema scenario, DiscountApplied every Monday at 5 PM is a time-triggered event.

Defining Time-Triggered Events: Consider scheduled impacts: “What events occur at specific times or intervals, regardless of user actions?”

6. Policies: Keeping Things in Check

Policies are rules governing system behavior. A policy in the cinema system might be “Tickets can be canceled within 24 hours of booking.”

Defining Policies: Establish governing rules: “What rules or constraints should guide the behavior of our system?”

7. Aggregates: Bundling Things Together

Aggregates are clusters of related entities treated as a single unit. In the cinema system, an aggregate could be a Movie with entities like Showtime and Seat.

Defining Aggregates: Group related entities and define rules: “What entities are closely related, and what rules maintain their consistency?”

8. Boundaries: Where Things Happen

Boundaries set limits for different parts of your system. Define clear distinctions between the Booking and Payment subsystems in the cinema system.

Defining Boundaries: Clarify subsystem limits: “What are the distinct parts of our system, and how can we manage their complexity independently?”

Conclusion

Event Storming goes beyond sticky notes and brainstorming; it’s a hands-on journey. By utilizing key components such as actors, commands, events, time-triggered events, policies, aggregates, and boundaries, you gain a clearer path through the complexities of your cinema booking system or any project.

Top comments (0)