Connecting the Dots, Data in Event Sourcing and Dimensional Modeling, How Close are They?

Photo by Hunter Harritt on Unsplash

Event Sourcing Design of the Online Book Store

ensures that all changes to application state are stored as a sequence of events

Image by Author
Image by Author

Dimensional Model Design of the Online Book Store

I want to see daily count of books sold for the last 3 months grouped by book category

Image by Author
SELECT
sales_date,
dim_book.category,
SUM(quantity)
FROM
fact_sales JOIN dim_book ON fact_sales.book_id = dim_book.book_id
WHERE
sales_date > DATE_SUB(CURRENT_DATE(), INTERVAL 3 MONTH)
GROUP BY 1, 2

So… How close?

References

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store