Skip to content

Latest commit

 

History

History

README.md

Github Sponsors blog blog

Samples

Samples are using CQRS architecture. They're sliced based on the business modules and operations. Read more about the assumptions in "How to slice the codebase effectively?".

  • Simplest CQRS and Event Sourcing flow using Minimal API,
  • Cutting the number of layers and boilerplate complex code to bare minimum,
  • Using all Marten helpers like WriteToAggregate, AggregateStream to simplify the processing,
  • Examples of all the typical Marten's projections,
  • Example of how and where to use C# Records, Nullable Reference Types, etc,
  • No Aggregates. Commands are handled in the domain service as pure functions.
  • typical Event Sourcing and CQRS flow,
  • DDD using Aggregates,
  • microservices example,
  • stores events to Marten,
  • distributed processes coordinated by Saga (Order Saga),
  • Kafka as a messaging platform to integrate microservices,
  • example of the case when some services are event-sourced (Carts, Orders, Payments) and some are not (Shipments using EntityFramework as ORM)
  • typical Event Sourcing and CQRS flow,
  • functional composition, no aggregates, just data and functions,
  • stores events to EventStoreDB,
  • Builds read models using Subscription to $all,
  • Read models are stored as Postgres tables using EntityFramework.
  • typical Event Sourcing and CQRS flow,
  • DDD using Aggregates,
  • stores events to EventStoreDB,
  • Builds read models using Subscription to $all.
  • Read models are stored as Marten documents.
  • simplest CQRS flow using .NET 5 Endpoints,
  • example of how and where to use C# Records, Nullable Reference Types, etc,
  • No Event Sourcing! Using Entity Framework to show that CQRS is not bounded to Event Sourcing or any type of storage,
  • No Aggregates! CQRS do not need DDD. Business logic can be handled in handlers.

Variation of the previous example, but:

Shows how to handle basic event schema versioning scenarios using event and stream transformations (e.g. upcasting):

Shows how to compose event handlers in the processing pipelines to:

  • filter events,
  • transform them,
  • NOT requiring marker interfaces for events,
  • NOT requiring marker interfaces for handlers,
  • enables composition through regular functions,
  • allows using interfaces and classes if you want to,
  • can be used with Dependency Injection, but also without through builder,
  • integrates with MediatR if you want to.
  • typical Event Sourcing and CQRS flow,
  • DDD using Aggregates,
  • microservices example,
  • stores events to Marten,
  • Kafka as a messaging platform to integrate microservices,
  • read models handled in separate microservice and stored to other database (ElasticSearch)
  • typical Event Sourcing and CQRS flow,
  • DDD using Aggregates,
  • stores events to Marten.
  • typical Event Sourcing and CQRS flow,
  • DDD using Aggregates,
  • stores events to Marten,
  • asynchronous projections rebuild using AsynDaemon feature.