https://github.com/kadirdemirkaya/saga-pattern
Saga pattern is an event-based sample project for a microservice in this project.
https://github.com/kadirdemirkaya/saga-pattern
masstransit saga-choreograph-pattern saga-orchestration saga-pattern sqlserver
Last synced: 7 months ago
JSON representation
Saga pattern is an event-based sample project for a microservice in this project.
- Host: GitHub
- URL: https://github.com/kadirdemirkaya/saga-pattern
- Owner: kadirdemirkaya
- Created: 2023-10-06T18:34:05.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T14:26:30.000Z (over 1 year ago)
- Last Synced: 2025-01-25T13:41:55.934Z (9 months ago)
- Topics: masstransit, saga-choreograph-pattern, saga-orchestration, saga-pattern, sqlserver
- Language: C#
- Homepage:
- Size: 12.5 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Saga Pattern
This project was done by using two different types (EventChoreography, Orchestration) in accordance with the saga pattern rules.
## EventChoreography
###### Event choreography is a model that describes the interaction of individual services in a system. Services use events to communicate with each other and coordinate operations.
- Projects inside
- BasketAPI
- OrderAPI
- PaymentAPI
- StockAPI
- SharedLIBRARY## Orchestration
###### Orchestration is a model that centrally manages and coordinates operations in a system. A master service or orchestrator directs other services and performs operations in a specified order and according to rules
- Projects inside
- BasketAPI
- OrderAPI
- PaymentAPI
- SharedLIBRARY
- StateMachineWorkerService
- StockAPI## Run on Your Computer
Clone the project
```bash
git clone https://github.com/kadirdemirkaya/SagaPattern.git
```Make your own changes to the .json file
```bash
appsettings.json
appsettings.Development.json
```Go to the project directory of the API projects and create a migration
```bash
cd BasketAPI
cd OrderAPI
...
```Then enter the directory of all api projects and stand up the server
```bash
dotnet run
```## Features
- Basket is created and data is sent in BasketAPI
- OrderAPI receives cart data and, depending on the situation, cancels or sends data for stock control
- If the stock is sufficient, data will be sent again for payment or canceled
- If the payment is made successfully in PaymentPI, the data is confirmed in the database or canceled in all services.
- The common library contains the data that all API services will use.
- MSSQL was used for all these operations
- The same events are handled in two different ways (EventChoreography and Orchestration)## Project Template

