Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Java Microservices: CQRS & Event Sourcing with Kafka
Role Play
Rating: 4.1 out of 5(1,236 ratings)
8,640 students

Java Microservices: CQRS & Event Sourcing with Kafka

Learn how to create microservices that are based on CQRS & Event Sourcing. Powered by Spring Boot and Apache Kafka.
Created bySean Campbell
Last updated 9/2025
English

What you'll learn

  • CQRS
  • Event Sourcing
  • Creating DDD-Oriented Microservices
  • Using MongoDB as an Event Store
  • Optimistic Concurrency Control
  • Event Versioning
  • Using Apache Kafka as a Message Bus
  • Implementing the Database-Per-Service Pattern
  • Spring Framework
  • Docker
  • Using MySQL 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

Course content

16 sections74 lectures4h 47m total length
  • Introduction1:46

    Students are introduced to the lecturer and told about everything that they will learn in the Java Microservices: CQRS & Event Sourcing with Kafka course.

  • Microservices Basics1:45

    Students will learn the basics about microservices and best practices that should be followed.

  • CQRS & Event Sourcing1:57

    This lecture will provide students with a clear understanding of CQRS and Event Sourcing.

  • Architecture Overview5:21

    Students will be provided with an architectural overview of the microservices that they are going to create.

  • Apache Kafka0:45

    Students will be introduced to Apache Kafka.

  • Introduction
  • Selling CQRS and Event Sourcing

Requirements

  • Basic understanding of Java programming language

Description

In this course you will learn how to create Spring Boot microservices that comply to 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 Java 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 MySQL.

  • Apply event versioning.

  • Implement optimistic concurrency control.

  • Produce events to Apache Kafka.

  • Consume events from Apache Kafka to populate and alter 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.

Who this course is for:

  • Software Engineers
  • Software Developers
  • Software Architects
  • Cloud Engineers
  • Solution Architects