30% OFF - Use code HANDSON30 for 30% off any course or Dometrain Pro! Browse courses →
  • Courses
  • Learning Paths
  • Blogs
  • Authors
  • Leaderboard
  • Dometrain Pro
  • Shopping Basket

    Your basket is empty

  • Business Portal
  • Deep Dive: Event Sourcing in .NET

    Deep dive into production-ready Event Sourcing in .NET

    About This Course

    Event Sourcing is a foundational design pattern in persistence architecture, frequently discussed in conjunction with CQRS and DDD. It revolves around the concept of capturing the events that lead to the current state instead of just storing the state itself, as traditionally done in CRUD systems with normalized databases. This approach operates on the premise that the current state can always be reconstructed from the sequence of events, but not the reverse. In our Deep Dive course, we will explore Event Sourcing in greater detail, utilizing the Marten library to implement a robust, production-ready event sourcing system. This course aims to provide a thorough understanding of the principles and patterns of Event Sourcing, diving deeper into its integration with CQRS architecture. By leveraging Marten, you will gain practical experience in building an application that effectively captures and processes events, showcasing how to create a powerful and flexible data management solution. Throughout the course, we will demystify the process of implementing event sourcing, enabling you to understand and utilize its capabilities fully. By the end of this Deep Dive course, you will have a comprehensive understanding of Event Sourcing, its intricate relationship with CQRS architecture, and the tools you need to implement it successfully in a production environment.

    Course Curriculum

    4h 45m 9 sections
    Welcome
    00:39 Free preview
    What will you learn in this course?
    00:51 Free preview
    Who is the course for and prerequisites
    01:00 Free preview
    Chapter introduction
    00:38
    Setting up PostgreSQL
    04:06
    What is Marten?
    03:36
    A quick refresher of our domain
    02:18
    Writing some events to a stream
    09:25
    Applying events to an aggregate
    10:05
    Projecting events
    11:31
    Where will Marten fit into our CQRS architecture?
    02:59
    Recap
    00:40
    Outline of our plan
    01:19
    Making the command handlers work
    17:24
    A disclaimer on abstractions
    01:46
    Marten's test strategy
    03:49
    Making our unit tests work again
    23:18
    Using Marten's projection system
    24:05
    Using subscriptions for our UI
    10:36
    Solution cleanup
    02:24
    Recap
    02:10
    What you should try to avoid
    02:55
    Is it really the same event?
    01:51
    Making non-breaking changes
    07:54
    Contract-breaking changes
    07:29
    Writing new streams
    05:45
    Recap
    03:08
    Introduction
    00:45
    Where & When do projections run?
    09:34
    Single Stream Projections
    07:42
    Multi-Stream Projections
    06:48
    Testing Projections
    08:34
    Recap
    02:01
    Why do we need more info?
    02:43
    A quick refactor
    10:38
    Logging commands
    11:25
    Adding event metadata
    06:59
    Recap
    01:20
    Why do we need snapshots?
    04:28
    Marten's built-in snapshots
    09:40
    Dealing with concurrency issues
    06:34
    Custom snapshots
    07:00
    Recap
    00:39
    Integration scenarios
    01:40
    Event Subscriptions
    06:59
    The Saga Pattern
    09:32
    Recap
    01:13
    Further resources
    02:58
    Conclusion
    01:35

    Meet Your Instructor

    Hannes Lowette

    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.

    View all courses by Hannes Lowette

    What's New

    Getting Started: Model Context Protocol (MCP)
    course

    Getting Started: Model Context Protocol (MCP)

    Learn how to get started with the Model Context Protocol (MCP) and integrate it into your applications.

    Learn more about Getting Started: Model Context Protocol (MCP)
    Hands-On: Learn TypeScript
    course

    Hands-On: Learn TypeScript

    Learn TypeScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn TypeScript
    Hands-On: Learn JavaScript
    course

    Hands-On: Learn JavaScript

    Learn JavaScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn JavaScript
    Hands-On: Data Structures & Algorithms in C#
    course

    Hands-On: Data Structures & Algorithms in C#

    Master data structures and algorithms through hands-on coding exercises in C#. Free to enroll for 7 days!

    Learn more about Hands-On: Data Structures & Algorithms in C#
    Blogsmith.ai
    feature

    Blogsmith.ai

    Turn your videos into blogs and newsletters with AI. Check out our new product at blogsmith.ai.

    Learn more about Blogsmith.ai
    Leaderboard
    feature

    Leaderboard

    See how you stack up against other learners. Track your progress, climb the ranks, and compete with the Dometrain community.

    Learn more about Leaderboard
    Hands-On: Learn PostgreSQL
    course

    Hands-On: Learn PostgreSQL

    Learn PostgreSQL through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn PostgreSQL
    Free Hands-On: C# for Beginners
    course

    Free Hands-On: C# for Beginners

    Learn C# through hands-on coding exercises. Practice what you learn with interactive challenges designed for everyone, from beginners to experts.

    Learn more about Free Hands-On: C# for Beginners
    Getting Started: AI for .NET Developers
    course

    Getting Started: AI for .NET Developers

    Get started with integrating AI into your .NET applications effectively using the latest LLM best practices.

    Learn more about Getting Started: AI for .NET Developers
    Getting Started: Building .NET Applications on AWS
    course

    Getting Started: Building .NET Applications on AWS

    Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

    Learn more about Getting Started: Building .NET Applications on AWS
    What's new in C# 14
    blog

    What's new in C# 14

    This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

    Learn more about What's new in C# 14
    Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    course

    Let's Build It: AI Chatbot with RAG in .NET Using Your Data

    Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

    Learn more about Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    From Zero to Hero: SignalR in .NET
    course

    From Zero to Hero: SignalR in .NET

    Enable enterprise-grade real-time communication for your web apps with SignalR.

    Learn more about From Zero to Hero: SignalR in .NET
    Deep Dive: Solution Architecture
    course

    Deep Dive: Solution Architecture

    Master solution architecture and turn business needs into scalable, maintainable systems.

    Learn more about Deep Dive: Solution Architecture
    Migrating: ASP.NET Web APIs to ASP.NET Core
    course

    Migrating: ASP.NET Web APIs to ASP.NET Core

    A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

    Learn more about Migrating: ASP.NET Web APIs to ASP.NET Core
    Getting Started: Caching in .NET
    course

    Getting Started: Caching in .NET

    Let's make the hardest thing in programming easy for .NET software engineers.

    Learn more about Getting Started: Caching in .NET
    From Zero to Hero: Testing with xUnit in C#
    course

    From Zero to Hero: Testing with xUnit in C#

    Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

    Learn more about From Zero to Hero: Testing with xUnit in C#
    Create a ChatGPT Console AI Chatbot in C#
    blog

    Create a ChatGPT Console AI Chatbot in C#

    This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

    Learn more about Create a ChatGPT Console AI Chatbot in C#