LIST

EventSourcing: projection vs cache

A projection is used to create a highly performant read-model. It is eventually consistent. A cache is used when replaying all events to build up state is too slow. “It checks first in a cache and if the object is not present, it will check in the event store.” (https://hackernoon.com/1-year-of-event-sourcing-and-cqrs-fb9033ccd1c6) If the cache is present, it will grab the cache, apply the events since the caching to build up the current state....

January 15, 2020

Video: Event Sourcing You are doing it wrong - David Schmitz

Event Sourcing You are doing it wrong by David Schmitz ( https://www.youtube.com/watch?v=GzrZworHpIk ) Paper_ The dark side of event souring_ managing data conversion - Michiel Overeen, Marten Spoor, Slinger Jansen [[filing-learning-notes/article-effective-aggregate-design-part-i-modeling-a-single-aggregate-vaughn-vernon.md|]]Article_ Effective Aggregate Design - Vaughn Vernon Book_ Versioning in an Event Sourced System - Greg Young Book_ Exploring CQRS and Event Sourcing - Microsoft resources for eventsourcing resources for eventsourcing The dark side of event souring: managing data conversion - Michiel Overeen, Marten Spoor, Slinger Jansen [[filing-learning-notes/article-effective-aggregate-design-part-i-modeling-a-single-aggregate-vaughn-vernon....

March 22, 2019

Code snippets from GregYoung 8 CQRS Class

Code snippets from GregYoung 8 CQRS Class - YouTube public class DeactivateInventoryItemCommand { public readonly Guid InventoryItemId; public readonly string Comment; public DeactivateInventoryItemCommand (Guid id, string comment) { InventoryItemId = id; Comment = comment; } void DeactivateInventoryItem(Guid, string comment) CommandHandler contains no logic, logic is in domain object delegates to domain object public class DeactivateInventoryItemHandler : Handles<DeactivateInventoryItem> { public DeactivateInventoryItemHandler(InventoryItemRepository rep){} void Handle(DeactivateInventoryItem cmd) { var item = repository.GetById(cmd.Id); item.Deactivate(cmd.Comment); } } Application Services cross-cutting concerns (logging, authentication)...

March 16, 2019

EventStore in relational DB

CQRS Documents - by Greg Young Events Column Type Comment AggregateId guid indexed, fk aggregates Data blob Version int unique within aggregate (UserId) guid (Timestamp) (CorrelationId) guid all events point to origin command (SequenceNumber) long auto-incrementingeventstore as queue Aggregates Column Type Comment AggregateId guid indexed, fk aggregates Type varchar fully qualified name Version int denormalized from Events Read event Select * from events where AggregateId =? Order by version Write event...

March 16, 2019

high level CQRS and Event sourcing

high level CQRS and Event sourcing client commands write / domain events read model dtos client

March 16, 2019

original code snippets from GregYoung 8 CQRS Class

Code snippets from GregYoung 8 CQRS Class - YouTube public class DeactivateInventoryItemCommand { public readonly Guid InventoryItemId; public readonly string Comment; public DeactivateInventoryItemCommand (Guid id, string comment) { InventoryItemId = id; Comment = comment; } void DeactivateInventoryItem(Guid, string comment) CommandHandler contains no logic, logic is in domain object delegates to domain object public class DeactivateInventoryItemHandler : Handles<DeactivateInventoryItem> { public DeactivateInventoryItemHandler(InventoryItemRepository rep){} void Handle(DeactivateInventoryItem cmd) { var item = repository.GetById(cmd.Id); item....

March 16, 2019

Video: GregYoung 8 CQRS Class

GregYoung 8 CQRS Class ( https://www.youtube.com/watch?v=whCk1Q87_ZI ) Code snippets from GregYoung 8 CQRS Class - YouTube original Code snippets from GregYoung 8 CQRS Class - YouTube

March 16, 2019

Course: CQRS in Practice

Course: CQRS in Practice (https://app.pluralsight.com/library/courses/cqrs-in-practice) CQRS & Onion Architecture Map CQRS & Onion Architecture where do C, Q, E belong? Map where do C, Q, E belong? Where to put Command Handlers Map Where to put Command Handlers Command reuse -> domain service Map Command reuse -> domain service Domain Service called for duplicate code Projections Map Choosing projection type A - database triggers...

March 10, 2019

Greg Young — A Decade of DDD, CQRS, Event Sourcing - YouTube

Greg Young — A Decade of DDD, CQRS, Event Sourcing ( https://www.youtube.com/watch?v=LDW0QWie21s )

March 9, 2019

Greg Young - CQRS and Event Sourcing - Code on the Beach 2014 - YouTube

Greg Young - CQRS and Event Sourcing - Code on the Beach 2014 https://www.youtube.com/watch?v=JHGkaShoyNs Notes: test without getters: 3:28:20 / 6:31:00 don’t care about state if I call ‘Deactivate’ twice, I get an exception that’s the invariant VERSIONING Event Versioning: 4:24:22 / 6:31:00 add both methods in aggregate upcasting old to new event When do we need to versionize events? -> when they were written to production dev? just throw away your local event log...

March 3, 2019