You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Novanet/2026/03/event-modeling.md
+9-20Lines changed: 9 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,28 +53,17 @@ That's it. Command comes in, event gets recorded, read model gets updated. Every
53
53
54
54
## A concrete example
55
55
56
-
Let's take a simple hotel booking system. Over time, the events on the timeline might look like this:
56
+
Here's a real event model — a visitor and room operations system:
57
57
58
-
```mermaid
59
-
timeline
60
-
title Hotel Booking - System Events Over Time
61
-
section Guest
62
-
RoomSearched : Guest browses availability
63
-
RoomSelected : Guest picks a room and dates
64
-
BookingCreated : Guest confirms the booking
65
-
section Payment
66
-
PaymentInitiated : Guest submits card details
67
-
PaymentApproved : Payment processor confirms
68
-
section Hotel Operations
69
-
RoomAssigned : Room assigned to booking
70
-
CheckInCompleted : Guest arrives and checks in
71
-
CheckOutCompleted : Guest leaves
72
-
RoomCleaningScheduled : Housekeeping notified
73
-
```
58
+

59
+
60
+
Reading it left to right, the system tells a story through five workflow slices:
61
+
62
+
Each vertical slice is independent. `AssignRoom` fires and `RoomAssigned` is recorded. `CheckIn` fires and `CheckinCompleted` is recorded. The `Visitor` read model is then *projected* from those events — it doesn't care how the data got there, it just reads the event stream and builds a view the front end can display.
74
63
75
-
Notice how the model tells a story. From the first interaction all the way through to the end. Anyone can follow it. You don't need a computer science degree to understand what's happening here.
64
+
Notice what this means in practice. A developer picking up the "Check In" slice knows exactly what they're building: handle the `CheckIn` command, validate it, record a `CheckinCompleted` event. Done. They don't need to understand the whole system. A product owner looking at the same model can ask: "What information do we need to show on the Visitor list?" — and point straight at the `Visitor` read model to have that conversation. An operations manager can trace what triggers a cleaning schedule without reading a single line of code.
76
65
77
-
And here's the thing — when a developer sees `BookingCreated`, they know exactly what to build. When a product owner sees `RoomCleaningScheduled`, they can immediately ask: "Should we notify the housekeeper by SMS or only in the app?" The model surfaces those conversations *before* they cost you three sprints to fix.
66
+
That's the point. Everyone is looking at the same thing, and everyone understands it.
78
67
79
68
---
80
69
@@ -137,7 +126,7 @@ Event Modeling and Event Sourcing are not the same thing — but they're natural
137
126
138
127
Event Modeling is a *design* technique. It works for any system, including traditional CRUD-style architectures. You don't need event sourcing to use it.
139
128
140
-
That said, if your system is built on event sourcing — where the events themselves are the source of truth — then the model and the implementation speak the same language from day one. The `RoomBooked` event in your model *is* the event your code produces and stores. No translation layer. No impedance mismatch.
129
+
That said, if your system is built on event sourcing — where the events themselves are the source of truth — then the model and the implementation speak the same language from day one. The `CheckinCompleted` event in your model *is* the event your code produces and stores. No translation layer. No impedance mismatch.
141
130
142
131
If you want to understand event sourcing more, I'd recommend [Martin Dilger's book](https://leanpub.com/eventmodeling-and-eventsourcing) — he covers both techniques and how they reinforce each other. I wrote separately about [event sourcing and why it matters](https://novanet.no/stop-losing-information-event-sourcing/) — the short version: stop throwing information away.
0 commit comments