Elektrine lite

← Feed

@maxitb@mastodon.social

Post #2870566

2025-04-03 13:58 UTC

@crashtestdev@woof.tech CQRS is not pointless. It's a way to allow high performance system to work in a highly concurrent environment without deadlocks while providing an easy way to implement rollbacks. But I agree that MediatR was always a bit overkill and there are better alternatives available for years now.

Replies (1)

  • @crashtestdev@woof.tech 2025-04-03 15:25

    @maxitb@mastodon.social that only works if you can manage access to your resources, MedtiatR doesn't have any ability to do that, it just resolves handlers (often, very slowly) and uses dependency injection to inject any resources, no different from injecting them straight into your controllers but with the added delay of MediatR resolving the correct handler And moving away from MediatR specifically, most resources dotnet devs will ever interact with will already be controlled by a query/command handler, like in the case of databases, that's what the database engine/server is doing, and it's going to be better suited, optimised and battle hardened to handle and schedule queries than anything that could be slopped out in dotnet

    Open ##2870567