Giter Site home page Giter Site logo

cqrs's Introduction

CQRS + Mediator Pattern

.NET core 7 ile CQRS + Mediator Pattern RabbitMq (Redis + SqlServer) ile Uygulandığı bir örnek.

WriteApi ve ReadApi içerisinde api versionlama kullanıldı. Swagger ile de arayüzde deprecated olmayan version default gözükmek üzere çalışıyor. Swagger özelinde XML dosyası kullanılarak Swagger arayüzü güzelleştirildi. Hatta swagger için css de kullandım.(wwwroot>swagger-ui) WriteApi SQL server kullanıyor. Verileri kaydederken aynı zamanda rabbitMQ daki ilgili kuyruğa event bilgisi ile birlikte entity gönderiyor. ReadApi Redis ten verileri okuyor. Consumer_WS bir worker service olarak geliştirildi. RabbitMq da kuyruğa eklenen verileri consume edip, redis e basıyor. Burada eventual consistency mevcut. CQRS in tek gördüğüm drawback i bu gibi.

DDD yaklaşımını uygulamaya çalıştım. Features klasörü içeriğinden bunu anlayabilirsiniz. Query ve Command isimlendirmeleri bir domainin bir businessina işaret ediyor. EventType gibi bir alan da DB de saklanıyor.

Çok falza geliştirme yapmadım sonuçta bir proje yapmıyordum. Desenleri tam olarak uygulayabildiğim redis ve rabbitmq yu da kullandığım güzel birörnek oldu bence.

bu servisler dockerize edilebilir ben henüz etmedim. kubernates de pub lar ile de yönetilebilir. Bir sonraki çalışmam bunun üzerine olacak.

EF Core code first kullandım. Burada entity framework default olara nvarchar kullanıyordu bunları varchar a çektim gerekli uzunlukları verdim. ReadApi görseli: docv1 image

deprecate olmuş WriteApi sürümü görseli:docv1 image

deprecate olmayan WriteApi sürümü görseli: docv2 image

redis görseli: image

docker görseli: image

rabbitmq görseli: tek kuyruk var, durable= true, autoack= false image

cqrs's People

Contributors

ugursinans avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.