Skip to content

Ace68/XmasDev2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XmasDev2023

Example for XmasDev 2023 conference

Scenario

When we have to deal with distributed systems we need to balance three forces

  • Communication (sync vs async)
  • Persistence (strong vs eventually)
  • Workflow (orchestrator vs choreography)

What is a Saga?

When your business workflow depends by more than one microservice, you have to manage it. A Saga is a Long Running Process that involves all the microservices requested. There are two kind of Sagas

  • Orchestrator
  • Choreography
    As you know, in Software Architecture, all is a Trade-Off, and which kind of Saga you choose is a trade-off. For this example I choose
  • Asynchronous communication
  • Eventually Consistency
  • Orchestrator workflow

The solution

In this solution you can find:

  • XmasBlazor example of Modular Architecture with lazy loading in FrontEnd
    A series of microservices:
  • XmasSagas to manage the Saga
  • XmasReceveir delegate to receive the xmas letter from children
  • XmasWarehouses delegate to prepare the xmas presents
  • XmasLogistics delegate to load the Santa Claus sleigh to send the presents to the children You need .NET 8 installed to run the examples.

CQRS

Is a pattern used to split the process of writing from the process of reading the data. It was introduced by Greg Young, and, as every pattern, is not a "one size fit all" solution, so please, handle with carefully!!!

Muflone

It's an open-source project to help you implementing Domain-Driven Design with Event-Driven approach.
You can find more details here
You can find more examples here

Microservices are not Distributed Monolithic

Each microservice in this solution has its own ReadModel (MongoDb) and its own EventStore.

Run Solution

  • Prepare Infrastructure: docker-compose up -d (inside docker folder)
  • XmasSagas:
  • docker build -t xmassagas .
  • docker run --rm -p 5000:8080 --name xmassagas xmassagas
  • XmasReceiver:
  • docker build -t xmasreceiver .
  • docker run --rm -p 5100:8080 --name xamsreceiver xmasreceiver
  • XmasWarehouses:
  • docker build -t xmaswarehouses .
  • docker run --rm -p 5200:8080 --name xmaswarehouses xmaswarehouses
  • XmasLogistics:
  • docker build -t xmaslogistics .
  • docker run --rm -p 5300:8080 --name xmaslogistics xmaslogistics

You can also use the docker-compose file for each microservice, instead of docker run

About

Examples for Xmas Dev Conference 2023

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors