4.50 (11 reviews)
☑ Saga Pattern
☑ Event Sourcing Pattern + CQRS
☑ Retry Pattern
☑ Circuit Breaker Pattern
☑ API Composition Pattern
Bu kursumda, microservice mimarilerde kullanabileceğimiz 5 tane design pattern yapısını öğreniyor olacaksıız.
Tüm örnekleri Asp.Net Core API (Net 5.0) ile geliştiriyor olacağız.
Design patterns :
Saga Design Pattern:
Saga design pattern is a way to manage data consistency across microservices in distributed transaction scenarios. A saga is a sequence of transactions that updates each service and publishes a message or event to trigger the next transaction step. If a step fails, the saga executes compensating transactions that counteract the preceding transactions.
Event Sourcing Pattern:
Instead of storing just the current state of the data in a domain, use an append-only store to record the full series of actions taken on that data. The store acts as the system of record and can be used to materialize the domain objects. This can simplify tasks in complex domains, by avoiding the need to synchronize the data model and the business domain, while improving performance, scalability, and responsiveness. It can also provide consistency for transactional data, and maintain full audit trails and history that can enable compensating actions.
Enable an application to handle transient failures when it tries to connect to a service or network resource, by transparently retrying a failed operation. This can improve the stability of the application.
Circuit Breaker Pattern
Handle faults that might take a variable amount of time to recover from, when connecting to a remote service or resource. This can improve the stability and resiliency of an application.
API Composition Pattern
This pattern uses an API composer, or aggregator, to implement a query by invoking individual microservices that own the data. It then combines the results by performing an in-memory join
SAGA - Choreography
Distributed transaction nedir ?
Saga implementasyon'ları nelerdir ?
Choreography temelli implementasyon senaryosu
Order API (Microservice)-1
Order API (Microservice)-2
Order API (Microservice)-3
Order API (Microservice)-4
Stock API (Microservice) -1
Stock API (Microservice) -2
Stock API (Microservice) -3
Payment API (Microservice) -1
Order API (Microservice)-5
Order API (Microservice)-6
Order API (Microservice)-7
Stock API (Microservice) -4
Saga - Orchestration
1. Adım (Projenin oluşturulması)
3. Adım (OrderStateInstance)
9. Adım (StockReservedEvent)
10. Adım (PaymentStockReservedRequestQueue)
11. Adım (PaymentCompletedEvent)
12. Adım (StockNotReservedEvent)
13. Adım (PaymentFailedEvent)
Event Sourcing Pattern
Circuit Breaker Pattern