Until January 2nd 2025, when you have more than one item in your basket, the cheapest one is FREE! Up to 3 orders per student. Happy Holidays!

Getting Started: Event Sourcing in .NET

Get started with Event Sourcing and CQRS in .NET

Event Sourcing is a persistence design pattern. It is often mentioned alongside CQRS and DDD. In short, it is the practice of storing the events that lead up to the current state instead of storing the state itself, as one would do in a CRUD system with a normalized database. The assumption is that it is always possible to re-create the state from the events, but not the other way around. Especially when Event Sourcing is combined with CQRS architecture, it enables a whole new way of thinking about data in your applications. It enables point-in-time data and the possibility to process old events against new features retroactively. In this course, the Event Sourcing principles and patterns are introduced, and we build an entire CQRS application from scratch to demonstrate how things piece together. We are not using a ready-made framework for this, but we are trying to take away the magic by building our own. At the end of this course, you should be familiar with event sourcing and how it fits with CQRS architecture.

Curriculum

Welcome (00:50)

What will you learn in this course? (01:10)

Who is the course for and prerequisites (01:39)

What is Event Sourcing? (06:05)

Commands vs Events (03:39)

Future, Present & Past (07:03)

The relationship with DDD (03:37)

Events, streams & aggregates (04:49)

The command handler life cycle (04:03)

CQRS architecture (06:42)

Section recap (00:50)

Introduction to our domain (06:33)

Modelling Events & Commands (08:52)

Value Types in commands & events (14:21)

Making root entities (05:16)

Building Command Handlers (19:23)

Adding a Command Router (07:29)

An exercise for you to make (01:49)

Section recap (00:40)

Introduction to the test base class (06:13)

Writing event sourced tests (05:17)

Making our tests more read readable (08:24)

Another exercice (00:56)

Section recap (00:42)

What are we going to build? (02:32)

A look at our starting point (06:24)

Building a simple event store (08:54)

Building a command API (04:10)

Alternate API approaches (03:47)

Finalizing & running our API (06:19)

Exercise time again! (00:27)

Section recap (00:40)

Checking out the read API (07:06)

Querying aggregate data (03:35)

Building a projection system (29:38)

Exercise (02:28)

Section recap (00:42)

The typical UI pattern (04:06)

Introducing the SignalR Hub (06:41)

Publishing our events over SignalR (09:48)

A final exercise (00:45)

Section recap (01:18)

What can our system now do? (09:48)

Beyond this course (04:03)

Conclusion (00:55)

Course Info

Level:
Getting Started
Duration:
4h 1m
Rating (New):
star

Lifetime access

Add to Cart
Dometrain Pro

Want access to all of our courses? Subscribe to Dometrain Pro!

Try it for free!

About the Author

author_img

Hannes Lowette

With 20 years in .NET development, Hannes has always been passionate about performance, databases, distributed systems and large-scale applications. When it comes to architecture, his opinions have become a bit more nuanced, and the "it depends" card, however boring, gets played in many technical discussions. Hannes has always had a passion for sharing knowledge. It doesn't matter whether it is one-to-one while pair programming, on a conference stage giving a talk or when he's helping people succeed in their careers as a coach. In his free time, when he's not building LEGO® castles with his three kids, he likes to stream his guitar building on Twitch and spends too much time playing online chess and doing all-around geeky stuff. You can always lure him into a chat over a glass of great Whisky.

More courses by Hannes Lowette