.NET Microservices: CQRS & Event Sourcing with Kafka (Udemy.com)
Learn how to create microservices in C# that are based on CQRS and Event Sourcing. Powered by .NET and Apache Kafka.
Created by: Sean Campbell
Last updated September 2025
What you will learn
- CQRS
- Event Sourcing
- How to Create Microservices in C# with .NET
- Creating DDD-Oriented Microservices
- Using Apache Kafka as a Message Bus
- Creating an Event Store with MongoDB
- Optimistic Concurrency Control
- Event Versioning
- Using Microsoft SQL to Implement the Read Database
- Replay the Event Store and Recreate the State of the Aggregate
- Replay the Event Store and Recreate the Entire Read Database
- Replay the Event Store and Recreate the Read Database in a Different Database Type - PostgreSQL
- Implementing the Database-Per-Service Pattern
- Entity Framework Core (MS SQL and PostgreSQL)
- Dependency Injection
- Docker
How it compares
Against the other 101 rated Udemy courses in Java Spring Framework on CourseDuck:
- Rating4.2 out of 5higher than 13% of them
- Reviews1,817#43 of 102 by number of reviews
- Length8.5 hoursshorter than 62% of them
- Last updatedSeptember 2025earlier than 55% of them
Course Description
In this course, you will learn how to create .NET microservices that comply with the CQRS and Event Sourcing patterns.
You will not use any CQRS framework, but you will write every line of code that is required to effectively create your own CQRS and Event Sourcing framework using C# and Apache Kafka. While this might sound a little daunting, you will be carefully guided step by step, and gain all the know-how and confidence to become an expert in CQRS and Event Sourcing.
By the end of this course, you will know how to:
Handle commands and raise events.
Use the mediator pattern to implement command and query dispatchers.
Create and change the state of an aggregate with event messages.
Implement an event store / write database in MongoDB.
Create a read database in MS SQL.
Apply event versioning.
Implement optimistic concurrency control.
Produce events to Apache Kafka.
Consume events from Apache Kafka to populate and alter records in the read database.
Replay the event store and recreate the state of the aggregate.
Separate read and write concerns.
Structure your code using Domain-Driven-Design best practices.
Replay the event store to recreate the entire read database.
Replay the event store to recreate the entire read database into a different database type - PostgreSQL.
The ultimate goal of this course is to take a deep-dive into the world of CQRS and Event Sourcing to enable you to create microservices that are super decoupled and extremely scalable.
Instructor Details
- 4.2 Rating
1,817 Reviews
Sean Campbell
Sean Campbell is a highly experienced Software Engineer, specializing in software development for over 20 years. He holds a Master of Science in Software Engineering degree and is particularly interested in software architecture, design patterns, engineering best practices (like SOLID principles), technical documentation, and AI. Sean has held Senior Software Engineer, Technical Lead, and Principal Engineer roles in various industries, including security, mining, insurance, health care, and affiliate marketing. He is an enthusiastic advocate of knowledge sharing and empowering others to become exceptional Software Engineers. Sean has a unique talent for simplifying complex topics to make them practical and easy to understand for anyone.
More courses by Sean Campbell
Microservices: Designing Highly Scalable Systems (2025)
4.4 (19,894 Reviews)
Provider: Udemy
Time: 1.3h
$11.99
Java Microservices: CQRS & Event Sourcing with Kafka (2025)
4.2 (1,241 Reviews)
Provider: Udemy
Time: 4.8h
$64.99
More Java Spring Framework courses
Spring Boot Unit Testing with JUnit, Mockito and MockMvc (2026)
4.8 (4,042 Reviews)
Provider: Udemy
Time: 9.9h
$84.99
Spring WebFlux Masterclass: High-Performance Reactive APIs (2026)
4.8 (1,920 Reviews)
Provider: Udemy
Time: 13.3h
$84.99
Spring Security Zero to Master along with JWT,OAUTH2 (2026)
4.7 (11,228 Reviews)
Provider: Udemy
Time: 24.6h
$12.99
Kafka MicroServices with Spring Boot, Docker, Kubernetes, AI (2026)
4.7 (6,864 Reviews)
Provider: Udemy
Time: 27.2h
$11.99
Domain Driven Design & Microservices for Architects (2023)
4.7 (3,982 Reviews)
Provider: Udemy
Time: 12.7h
$10.99
Microservices with Spring Boot, Spring Cloud, Docker & Kafka (2026)
4.7 (3,777 Reviews)
Provider: Udemy
Time: 42.1h
$94.99
Reviews
By Kader Kivrak on 2/7/2026
the kafka and zookeeper images on docker hub used in this course are no longer active. it is no longer possible to follow this tutorial from section 2 because of this. it is also not possible to get a refund because i have watched a few minutes of the tutorial that ends up being useless early on.
By Maricel Bacacao on 10/29/2025
I've learned a lot from this course. My only complaint is the way it is being structured. You have to go through a lot of sections, code multiple lines and files before you can even see the output. It would be better if the slice is done vertically in order to see the flow on each usecase from top to bottom like: do the add command, from controller to publish and consumed. Then proceed with another use case...
By Philip Ong on 11/30/2024
Very well conducted with advanced programming technique and SOLID principals. Would be perfect if in future can add new section to talk about how to handle new changes in existing event and entity like introducing new property into existing event or removing property.
By Yener Yardim on 8/8/2024
Great introductory course to Kafka, EventSource & how they mingle together with read database & dotnet. I specifically enjoyed the simple custom cqrs mediator design. The postgres db switch at the end was a nice suprise as well. I look forward to a more advanced course with a multiple topics, saga. A conversion of a sample monolithic app to microservices would be awesome. Thanks
By Andres Villarroel Mayorga on 3/2/2024
The Good: - I came here for the Event sourcing part which I could say it was what I expected to learn. - The instructor guides you step by step on every aspect and reply your concerns or questions. The Bad: : - there are parts that are hard to follow like using vs code to create projects, add references and nugget packages, hopefully I was able to follow along more easily using visual studio instead of vs code. Though I have learned how to use the terminal to create projects, which is nice but it kills productivity - The controllers part was bad designed, it really messes up creating a new controller for each action. there is a reason why REST was introduced with Verbs. controllers names should be nouns for resources not verbs. - The exception handling on controllers could have been implemented better with middleware to avoid duplicate code on each endpoint. Overall I can say I learned new good stuff especially event sourcing and how to replay events which was really cool.
By Vlad on 2/3/2024
The topic itself is difficult to understand, however watching, following and recreating project add more confidence that somthing that seems very difficult can be actually achieve. Even if some parts are still not understood, the most of the course information was asimilated.
By Erfan Shokrollahi on 1/10/2024
This was one of the interesting and yet clearly focused courses I have ever taken. The author focuses on main topics and make them practical with shortest effort possible. Although there are more steps to dive deeper into each discussion, I think the core concept is more important than details. Thanks for good job. I learned a lot in a short time.
By Michael Hienny on 9/28/2023
That's a great course but there are still some points that are missing. e.g What about having multiple micro services that needs to handle events from each others as they might need to update their respective read database in order to improve read performances.. I would really like to have recommendations/best practices on how to manage such behaviour.
By Tsepo Motswaine on 7/27/2023
Now this is a quality course. The instructor did a great job of explaining each and every line of code without wasting time. Now I have an in-depth understanding of CQRS, Kafka, and Event Sourcing. The last section on recreating the read DB from the Event Store blew my mind. Thanks again!
By Egzon Krasniqi on 8/14/2022
This course was good, even though I didn't like the naming of projects like 'SM-Post' or 'CQRS-ES' it was very confusing. I suggest for your future courses to use real world project names and not technical naming's. Other than that, the course was very helpful to learn CQRS and Event Sourcing.
Quality Score
No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.
Overall Score : 84 / 100








