Microservices: Clean Architecture, DDD, SAGA, Outbox & Kafka

Microservices: Clean Architecture, DDD, SAGA, Outbox & Kafka

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 107 lectures (18h 0m) | 11.32 GB

Learn Spring boot microservices with Clean & Hexagonal architectures, DDD, SAGA, Outbox, CQRS, Kafka, Kubernetes & GKE

Hi there! My name is Ali Gelenler. I’m here to help you learn microservices architecture while applying Clean and Hexagonal Architectures and using Domain Driven Design.

In this course, you will focus on architectural aspects of microservices architecture and use Clean Architecture principles while developing each service. In the implementation of the domain layer you will also apply Domain Driven Design principles.

You will implement SAGA, Outbox and CQRS patterns using the 5 Spring boot Java microservices that you will develop using Clean and Hexagonal architecture principles.

You will also learn and use Apache Kafka as the event store, and use events to communicate between services, and to implement the architectural patterns.

The concepts that you will be learning and implementing are:

  • Spring boot microservices
  • Clean Architecture
  • Hexagonal Architecture
  • Domain Driven Design
  • Event-driven services using Apache Kafka
  • SAGA Architecture Pattern
  • Outbox Architecture Pattern
  • CQRS Architecture Pattern
  • Kubernetes on local using Docker desktop
  • Kubernetes on Google Cloud using Google Kubernetes Engine(GKE)

To communicate with the data stores in microservices you will use Spring Data JPA for PostgreSQL, and Spring Kafka for Kafka.

You will be following a hands-on approach and developing a project from scratch. You will have 5 microservices that communicate using events with Kafka as the event store.

At the end of the course you will understand how to run an event-driven microservices architecture with Clean and Hexagonal Architecture principles and with Domain Driven Design concepts. You will use Spring boot and Java to develop the microservices. You will also learn implementing architectural microservices patterns such as SAGA, Outbox and CQRS. In the end you will be able to deploy your application to Kubernetes on Google Cloud using Google Kubernetes Engine.

I have followed the same clean & hexagonal architectures and domain driven design principles in the implementation of each microservice. If you feel like you want to skip some repeating parts, you may download the source code that I provide in the first lecture of each section starting from section-3. You can then use the provided source code to continue with the section.

For more detailed information on the progress of this course, you can check the introductory video and free lessons, and if you decide to enroll in this course, you are always welcome to ask and discuss the concepts and implementation details on Q/A and messages sections. I will guide you from start to finish to help you successfully complete the course and gain as much knowledge and experience as possible from this course.

What you’ll learn

  • Develop Microservices Architecture using Spring Boot and Kafka
  • Understand and Apply Clean Architecture
  • Understand and Apply Hexagonal Architecture
  • Understand and Apply Domain Driven Design(DDD)
  • Implement SAGA Architecture Pattern
  • Implement Outbox Architecture Pattern
  • Implement CQRS Architecture Pattern
  • Learn Kafka Architecture and Programming on Kafka
  • Learn using Kafka as the Event Store for Event-Driven Services
  • Learn Kubernetes basics & Run a local cluster using Docker desktop
  • Deploy microservices to local Kubernetes Cluster
  • Run Confluent Kafka on Kubernetes using cp-helm-charts
  • Run Postgres on Kubernetes
  • Learn Google Cloud and Google Kubernetes Engine(GKE)
  • Deploy microservices to Google Kubernetes Engine
Table of Contents

Introduction
1 Structure of the course
2 Project overview Part 1
3 Project overview Part 2
4 Setting up the environment

Clean Architecture Hexagonal Architecture
5 Introduction to Clean and Hexagonal Architectures
6 Designing components for Order Service using Clean Architecture
7 Creating Order Service modules using Clean Architecture PART 1
8 Creating Order Service modules using Clean Architecture PART 2

Domain Driven Design DDD
9 Introduction to Domain Driven Design
10 Designing Order Service domain logic components
11 Creating common domain module with base Entity and Aggregate Root classes
12 Adding value objects and domain events to common domain module
13 Implementing Order Service domain logic using DDD Order Aggregate Root
14 Adding Order Entity implementation methods
15 Adding state changing methods to Order Entity
16 Implemeting Domain Events in Order Service domain layer
17 Implementing Order Domain Service
18 Implementing Order Application Service DTO classes
19 Adding Mapper class and port definitions to Order Application Service
20 Implementing input ports in Order Application Service
21 Implementing message publisher in Order Application Service to fire the events
22 Implementing Order Track Command Handler
23 Testing Order Service domain logic Part 1
24 Testing Order Service domain logic Part 2

Apache Kafka
25 Introduction to Apache Kafka
26 Running Apache Kafka using Docker
27 Implementing Kafka config data generic module
28 Implementing Kafka model generic module
29 Implementing Kafka producer generic module
30 Implementing Kafka consumer generic module

Completing Order service components
31 Application module Adding Web Controller
32 Application module Adding Controller Advice
33 Data access module Adding Order JPA Entity
34 Data access module Adding JPA Repository Adapter implementation
35 Data access module Adding Customer and Restaurant implementations
36 Messaging module Adding Mapper and Config Data
37 Messaging module Adding Publisher implementations
38 Messaging module Adding Listener implementations
39 Container module Adding spring boot starter class and config
40 Container module Explaining kafka consumer properties
41 Container module Adding Order database schema file
42 Creating Customer Service Running Order Service

Implementing Payment Service
43 Domain core module Adding Aggregate Root Entity and Value objects
44 Domain core module Adding Exception and Domain events
45 Domain core module Implementing Payment Domain Service
46 Application Service domain module Adding Mapper Config and Ports
47 Application Service domain module Implementing input ports Part 1
48 Application Service domain module Implementing input ports Part 2
49 Application Service domain module Refactoring fire event process
50 Implementing Data Access module
51 Implementing Messaging module Adding Mapper and Publishers
52 Implementing Messaging module Adding Listeners
53 Implementing Container module

Implementing Restaurant Service
54 Domain core module Adding Aggregate Root and Entities
55 Domain core module Adding Exception Domain events and Domain Service
56 Application Service domain module Adding Mapper DTO and Ports
57 Application Service domain module Implementing input ports
58 Implementing Data Access module
59 Implementing Messaging module
60 Implementing Container module

SAGA Architecture Pattern
61 Introduction to SAGA pattern
62 Implementing Order Payment Saga
63 Using Order Payment Saga in Messaging Implementing Order Approval Saga
64 Testing the application endtoend with SAGA pattern changes
65 Testing failure scenarios

Outbox Architecture Pattern
66 Introduction to Outbox pattern
67 Updating Order Service database schema and config for Outbox Pattern
68 Refactoring Order domain layer Adding Outbox models Updating ports
69 Refactoring Order domain layer Adding Outbox scheduler
70 Refactoring Order domain layer Adding Outbox cleaner scheduler for Payment
71 Refactoring Order domain layer Adding Outbox schedulers for Approval
72 Refactoring Order domain layer Updating OrderCreate Command Handler
73 Refactoring Order domain layer Updating Order Payment Saga Part 1
74 Refactoring Order domain layer Updating Order Payment Saga Part 2
75 Refactoring Order domain layer Updating Order Approval Saga
76 Updating the Order Application Service Test for Outbox pattern changes
77 Refactoring Order Data Access module for Outbox pattern
78 Refactoring Order Messaging module for Outbox pattern Part 1
79 Refactoring Order Messaging module for Outbox pattern Part 2
80 Testing Order Payment Saga
81 Updating Payment database schema config and package structure for Outbox
82 Refactoring Payment domain layer Adding Outbox schedulers
83 Refactoring Payment domain layer Updating Message listener implementation
84 Refactoring Payment Data Access module for Outbox pattern
85 Refactoring Payment Messaging module for Outbox pattern
86 Testing Payment Request Message Listener for double payment
87 Refactoring Restaurant Service for Outbox pattern Part 1
88 Refactoring Restaurant Service for Outbox pattern Part 2
89 Testing the application endtoend with Outbox pattern changes
90 Testing failure scenarios

CQRS Architecture Pattern
91 Introduction to CQRS pattern
92 Creating Customer Kafka topic Customer modules
93 Implementing Customer Service modules
94 Updating Order Service to use local database table with CQRS pattern
95 Running Order and Customer Services to test CQRS pattern

KubernetesK8s
96 Introduction to Kubernetes and running a local Kubernetes using Docker Desktop
97 Deploying Confluent Kafka to local Kubernetes using cphelmcharts
98 Creating Kubernetes deployment files for Microservices
99 Deploying Microservices into local Kubernetes
100 Deploying Postgres to local Kubernetes using Postgres docker image

K8s Google Kubernetes EngineGKE
101 Creating Google Cloud account Creating a Kubernetes cluster in GKE
102 Pushing docker images to Google Artifact Registry
103 Running the Application on Google Kubernetes Engine Part 1
104 Running the Application on Google Kubernetes Engine Part 2
105 Adding horizontal scaling to services
106 Next steps Thank you

Version updates Update to latest Spring boot Spring cloud other dependencies
107 Update to spring boot 275

Homepage