Skip to content

From Events to Insights

Event Sourcing gives you a complete, immutable history of everything that has happened in your domain. Data Mesh turns that history into discoverable, reliable, and reusable data products. AI, Machine Learning, and Data Science use those products to create predictions, recommendations, and decisions. Together, they form a continuous path from events to insights.

Step 1 – Capturing the Facts

It starts with domain events. These are written in the language of the business – for example, in the library domain:

  • BookBorrowed
  • LoanExtended
  • BookReturned
  • LateFeeIncurred

Each event is immutable, timestamped, and stored in the order it occurred.

Because the history is complete, you are not limited to one interpretation of the data. New perspectives, analytical questions, and predictive models can all be explored without changing the original record.

Step 2 – Building Analytical Projections

Raw events are powerful but not always in the right shape for analysis. Projections transform the event stream into structured, queryable data:

  • Time series of loans per title
  • Member borrowing histories
  • Aggregated overdue statistics

These projections can be rebuilt at any time, ensuring they always reflect the full and correct history.

Step 3 – Creating Features and Models

From projections, you derive features – measurable variables used in statistical models or machine learning:

  • Borrowing frequency, overdue rates, or seasonal demand patterns
  • Member engagement scores based on loan activity
  • Title popularity trends for forecasting

Because features come from well-defined events, their meaning is clear, making them easier to validate and explain. This is the link between data and domain understanding.

Step 4 – Sharing as Data Products

Once projections and features are in place, apply Data Mesh principles to make them discoverable, reliable, and reusable across the organization. Each product comes with clear ownership, quality guarantees, and documented APIs – enabling AI and analytical systems to consume them directly.

This means the same event history can power multiple use cases: operational dashboards, predictive models, research studies, and more.

Step 5 – Closing the Loop

Insights are most valuable when they influence decisions. Predictions from a model might trigger automated actions, guide staff in prioritizing work, or inform policy changes. Because every resulting action is captured as a new event in the event store, you can measure the impact of those decisions over time, refine your models, and repeat the cycle.

From capturing events to sharing insights, the path is continuous and repeatable – each stage builds on the previous one, and the preserved history ensures that every insight can be traced back to the events that made it possible.

Ready to go deeper? In our Walkthrough of Event Sourcing and AI, you'll follow this path step by step – from writing domain events to generating projections, creating features, and delivering insights.