Eventual Consistency is the term most people refer to when they are reading from a different data source from where they perform a write. Usually leads to a bad user experience where a user performs some action but then doesn’t see their change reflected in the UI immediately. There can be many reasons for this. It could be from using a read replica that is eventually consistent. If you’re using Event Sourcing with Projections as your Read Model, which is built asynchronously. Or if you’re processing commands asynchronously via a message queue. YouTube Check out my YouTube channel where I post all… Read More »Eventual Consistency is a UX Nightmare
Want to see an example of how CQRS & Event Sourcing work together? Here’s a code walk-through that illustrates sending commands to your domain that stores Events in an Event Store. The Events are then published to Consumers that updated Projections (read models) that are then consumed by Queries. This is the stereotypical set of patterns used when using CQRS and Event Sourcing together. YouTube Check out my YouTube channel where I post all kinds of content that accompanies my posts including this video showing everything that is in this post. CQRS & Event Sourcing Because CQRS and Event Sourcing are so… Read More »CQRS & Event Sourcing Code Walk-Through
The repository pattern is polarizing. Some developers swear you should always use it to abstract data access logic while others think it’s unnecessary if you’re using an ORM. So should you use it? My answer is Yes and No! If you’re applying CQRS and Vertical Slice Architecture you’ll likely want a repository to build up Aggregates. However, for a Query, you may want to just get the data you need rather than an entire aggregate (or collection of aggregates) to build a view model. YouTube Check out my YouTube channel where I post all kinds of content that accompanies my posts including… Read More »Should you use the Repository Pattern? With CQRS, Yes and No!