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.
.NET Microservices: CQRS & Event Sourcing with Kafka
8h 31m 56s
English
Paid
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.
About the Author: udemy
By connecting students all over the world to the best instructors, Udemy is helping individuals reach their goals and pursue their dreams. Udemy is the leading global marketplace for teaching and learning, connecting millions of students to the skills they need to succeed. Udemy helps organizations of all kinds prepare for the ever-evolving future of work. Our curated collection of top-rated business and technical courses gives companies, governments, and nonprofits the power to develop in-house expertise and satisfy employees’ hunger for learning and development.
Watch Online 91 lessons
0:00
/ #1: Microservices Basics
All Course Lessons (91)
| # | Lesson Title | Duration | Access |
|---|---|---|---|
| 1 | Microservices Basics Demo | 03:52 | |
| 2 | CQRS | 02:27 | |
| 3 | Event Sourcing | 01:22 | |
| 4 | Architecture Overview | 06:50 | |
| 5 | Apache Kafka | 01:04 | |
| 6 | Setup & Structure Section Intro | 00:27 | |
| 7 | Prerequisites | 08:09 | |
| 8 | Run Kafka in Docker | 05:39 | |
| 9 | Run MongoDB in Docker | 02:34 | |
| 10 | Run Microsoft SQL in Docker. | 05:07 | |
| 11 | Basic Project Setup | 08:59 | |
| 12 | Adding Project References | 10:21 | |
| 13 | Adding NuGet Packages | 05:21 | |
| 14 | Setup Debug Configurations (VS Code Only) | 02:52 | |
| 15 | What is a Command? | 00:55 | |
| 16 | Commands | 05:01 | |
| 17 | What is an Event? | 00:32 | |
| 18 | Events | 08:23 | |
| 19 | The Mediator Pattern | 03:11 | |
| 20 | ICommandDispatcher Interface (The Mediator) | 02:47 | |
| 21 | CommandDispatcher (The Concrete Mediator) | 05:33 | |
| 22 | What is an Aggregate? | 02:17 | |
| 23 | AggregateRoot | 09:51 | |
| 24 | PostAggregate Part 1 | 12:27 | |
| 25 | PostAggregate Part 2 | 08:21 | |
| 26 | What is an Event Store? | 01:04 | |
| 27 | EventModel | 03:23 | |
| 28 | IEventStoreRepository Interface | 02:34 | |
| 29 | EventStoreRepository | 09:17 | |
| 30 | IEventStore Interface | 01:21 | |
| 31 | EventStore | 11:27 | |
| 32 | IEventSourcingHandler Interface | 01:43 | |
| 33 | EventSourcingHandler | 06:56 | |
| 34 | The Mediator Pattern Continued | 00:46 | |
| 35 | ICommandHandler Interface (The Abstract Colleague) | 01:55 | |
| 36 | CommandHandler (The Concrete Colleague) | 10:07 | |
| 37 | Register Command Handlers | 05:09 | |
| 38 | Kafka Producer | 03:19 | |
| 39 | EventProducer Interface & Implementation | 10:02 | |
| 40 | Producing an Event | 05:34 | |
| 41 | Important DDD Concepts | 01:26 | |
| 42 | Domain Entities | 05:28 | |
| 43 | IPostRepository Interface | 03:47 | |
| 44 | ICommentRepository Interface | 01:47 | |
| 45 | The Read Database | 00:27 | |
| 46 | DatabaseContext | 09:34 | |
| 47 | Programmatically Create DB & Tables on Startup | 07:44 | |
| 48 | PostRepository | 08:27 | |
| 49 | CommentRepository | 05:03 | |
| 50 | Event Handling Introduction | 00:21 | |
| 51 | IEventHandler Interface | 01:43 | |
| 52 | EventHandler | 09:43 | |
| 53 | Kafka Consumer | 03:40 | |
| 54 | IEventConsumer Interface | 00:39 | |
| 55 | EventJsonConverter | 07:49 | |
| 56 | EventConsumer | 11:58 | |
| 57 | ConsumerHostedService | 06:36 | |
| 58 | Command Controllers Intro | 00:39 | |
| 59 | Data Transfer Objects | 01:25 | |
| 60 | NewPostController | 08:30 | |
| 61 | Creating a New Social Media Post | 15:05 | |
| 62 | EditMessageController | 05:33 | |
| 63 | Edit Message of a Social Media Post | 12:09 | |
| 64 | LikePostController | 03:25 | |
| 65 | Like a Social Media Post | 10:57 | |
| 66 | AddCommentController | 03:07 | |
| 67 | Add a Comment to a Social Media Post | 11:25 | |
| 68 | EditCommentController | 03:20 | |
| 69 | Edit a Comment on a Social Media Post | 12:12 | |
| 70 | RemoveCommentController | 04:24 | |
| 71 | Delete a Comment from a Social Media Post | 11:09 | |
| 72 | DeletePostController | 02:57 | |
| 73 | Deleting a Social Media Post | 10:21 | |
| 74 | The Mediator Pattern (Query Dispatching) | 01:03 | |
| 75 | Social Media Queries | 03:37 | |
| 76 | IQueryDispatcher Interface (The Mediator) | 03:34 | |
| 77 | QueryDispatcher (The Concrete Mediator) | 05:45 | |
| 78 | Query Handling Introduction | 00:23 | |
| 79 | IQueryHandler Interface (The Abstract Colleague) | 01:45 | |
| 80 | QueryHandler (The Concrete Colleague) | 04:29 | |
| 81 | Register Query Handlers | 04:25 | |
| 82 | Query Controller Intro | 00:18 | |
| 83 | Data Transfer Objects | 01:14 | |
| 84 | PostLookupController Part 1 | 09:59 | |
| 85 | PostLookupController Part 2 | 09:00 | |
| 86 | Testing the PostLookupController | 16:49 | |
| 87 | Powerful Ending Intro | 00:41 | |
| 88 | Create Functionality to Restore the Read Database | 12:28 | |
| 89 | Restore the Entire Read Database | 20:06 | |
| 90 | Rapidly Change the Read Database Type | 14:06 | |
| 91 | Congratulations | 00:25 |
Unlock unlimited learning
Get instant access to all 90 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.
Learn more about subscription